COT 5405 Spring 2007 Advanced Algorithms
Chris Lacher
Exam 1 Review
Define and describe in detail these components of an algorithm:
Assumptions
Body
Conclusions
Proof
Analysis
Which, if any, of these components are optional?
Why are algorithms important? (30 words max)
Prove a result about asymptotic bounds. Examples:
if F(n) <= O(G(n)) then G(n) >= Ω(F(n))
if F(n) <= O(G(n)) and F(n) >=
Ω(G(n)) then F(n) = Θ(G(n))
if F(n) <= O(G(n)) and G(n) <=
O(H(n)) then F(n) <= O(H(n))
Let P(n) = 0.1n4 + n3 + 10n2 +
100. Prove that P(n) = Θ(n4)
For the algorithm X
State the assumptions
State the body in C-like pseudocode
What is the worst case runtime? (State in general, and give an illustrative example.)
What is the best case runtime? (State in general, and give an illustrative example.)
What is the average case runtime? (State in general, and give an informal proof.)
Possible values for X: SequentialSearch, LowerBound, UpperBound,
SelectionSort, InsertionSort, QuickSort
Sketch a proof that a Set implemented as a height-balanced tree has search,
insert, and remove runtimes <= O(log n) where n = number of elements
in the set.
Analyze the standard traversal loop for a binary tree
For a specific binary tree, give the edge moves for each step in a
traversal; know what the sum of these counts should be.