CS 473
Headbanging 2 (September 1011)
Fall 2013
1. A longest common subsequence of a set of strings cfw_Ai is a longest string that is a subsequence of Ai
for each i. For example, alrit is a longest
CS 473
Homework 8 (due November 5 2013)
Fall 2013
1. Let G = (V, E) be a directed graph with nonnegative real weights on edges. Each edge has a color
chosen from cfw_RED, WHITE, BLUE. An American path
CS 473
1.
HW0 solutions
Fall 2013
(a) Prove that every balanced string is erasable.
(b) Prove that every erasable string is balanced.
Solution (separate proofs with helpful lemmas):
(a) We prove the r
CS 473
Headbanging 9 Oct. 29/30
Fall 2013
1. Consider a path between two vertices s and t in an undirected weighted graph G. The bottleneck
length of this path is the maximum weight of any edge in the
Headbanging Nov. 04/05
CS 473
Fall 2013
1. AMORTIZED ANALYSIS. [Fall 2002, Spring 2004]
Suppose we want to maintain a set X of numbers, under the following operations:
INSERT(x): Add x to the set (if
CS 473
Headbanging 8 Oct. 22/23
Fall 2013
1. Let G be an undirected graph.
(a) We put two coins on two arbitrarily chosen nodes. At every step, each coin must move to an
adjacent node. Describe an alg
CS 473
Headbanging 7 Oct. 15/16
Fall 2013
1. Recall the staircase problem from the midterm:
Let P be a set of n points in the plane. The staircase of P is the set of all points in
the plain that have
CS 473
Headbanging 6 Oct. 08/09
Fall 2013
1. Suppose you have an interface for a STACK with the following operations implemented in constant
time:
(a) PUSH pushes an element on top of the stack.
(b) P
CS 473
Headbanging 4 (October 12)
Fall 2013
Note: All the questions in this session are taken from past CS473 midterms.
1. (Fall 2006) Multiple Choice: Each of the questions on this page has one of th
CS 473
Headbanging 5
Fall 2013
1. Suppose you have an interface for a STACK with the following operations implemented in constant
time:
(a) PUSH pushes an element on top of the stack.
(b) POP removes
CS 473
Headbanging 3 (September 2526)
Fall 2013
1. A vertex cover of a graph is a subset S of the vertices such that every vertex v either belongs to S
or has a neighbor in S. In other words, the vert
CS 473
Headbanging 1 (September 34)
Fall 2013
1. An inversion in an array A[1 . n] is a pair of indices (i, j) such that i < j and A[i] > A[ j]. The
n
number of inversions in an n-element array is bet
CS 473: Undergraduate Algorithms, Fall 2013
Headbanging 0: Induction!
August 28 and 29
1. Prove that any non-negative integer can be represented as the sum of distinct powers of 2. (Write
it in binary
CS 473
Headbanging 8 Oct. 22/23
Fall 2013
1. Let G be a directed graph with a special source that has an edge to each other node in graph,
and denote scc(G) as the strong component graph of G. Let S a