Introduction to Algorithms
May 10, 2005
Massachusetts Institute of Technology
6.046J/18.410J
Professors Charles E. Leiserson and Ronald L. Rivest
Practice Final Exam—From Fall 2004
Practice Final Exam—From Fall 2004
Problem 1.
Recurrences
(4 parts) [8 points]
For each of the recurrences below, do the following:
•
Give the solution using
Θ
notation. You need not provide a proof or other justification.
•
Name a recursive algorithm we’ve seen during the term whose running time is described by
that recurrence.
(a)
T
(
n
) =
T
(
n/
2) + Θ(1)
(b)
T
(
n
) = 2
T
(
n/
2) + Θ(
n
)
(c)
T
(
n
) =
T
(
n/
5) +
T
(7
n/
10) + Θ(
n
)
(d)
T
(
n
) = 7
T
(
n/
2) + Θ(
n
2
)
Problem 2.
Design Techniques and Data Structures
(5 parts) [10 points]
For each of the following design techniques and data structures, name an algorithm covered this
term that uses it.
(a)
Divide and conquer:
(b)
Dynamic programming:
(c)
Greedy:
(d)
Binary search tree:
(e)
FIFO queue:
Problem 3.
True or False, and Justify
(12 parts) [84 points]
Circle
T
or
F
for each of the following statements to indicate whether the statement is true or
false, respectively. If the statement is correct, briefly state why. If the statement is wrong, explain
why. The more content you provide in your justification, the higher your grade, but be brief. Your
justification is worth more points than your trueorfalse designation.
(a)
T F
If
f
(
n
)
is asymptotically positive, then
f
(
n
) +
o
(
f
(
n
)) = Θ(
f
(
n
))
.
(b)
T F
An adversary can provide an input to randomized quicksort that will elicit
1
its
Θ(
n
2
)
worstcase running time.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 ErikDemaine
 Algorithms, Graph Theory, Glossary of graph theory

Click to edit the document details