Fundamental Algorithms Final Exam
Fundamental Algorithms Final Exam
FINAL EXAM
There will be little rubs and disappointments everywhere, and
we are all apt to expect too much; but then, if one scheme of
happiness fails, human nature turns to another; if the first cal-
culation is wrong, we make a second better.
from Mansfield Park by Jane Austen
4. (5) In a max Heap what is the property of the value at the root? (That
is, how does it compare to the values of the other nodes.)
(a) Prove (yes, prove!) that the Minimal Spanning Tree necessarily
contains that edge e = {x, y} with x S and y 6 S which has
minimal weight. A good picture wont hurt. Assume no two
edges have the same weight. (Warning: Saying that an algorithm
tells you to pick this edge e is not a proof!)
(b) In what algorithm is the above result used.
6. (10) Consider the recursion T (2n) = 3T (n) + n + 1 with initial value
T (1) = 5.
11. (5) What was the breakthrough of Agrawal, Kayal and Saxena?
12. (20) In Depth-First Search each vertex v gets a discovery time d[v] and
a finishing time f [v]. Let G be a graph and v, w two distinct vertices
for which w Adj[v].
(a) Assume d[v] < d[w]. Argue that f [w] < f [v].
(b) Now further assume that G is a DAG (a Directed Acyclic Graph.)
Assume d[w] < d[v]. Argue that f [w] < f [v].
13. (5) What is the difference, if any, between a (lg n) algorithm and a
(log10 n) algorithm? (Short reason please.)
In the end the great truth will have been learned, that the quest
is greater than what is sought, the effort finer than the prize, or
rather that the effort is the prize, the victory cheap and hollow
were it not for the rigor of the game.
Justice Benjamin Cardozo