
ECS 122A: Algorithm Design and Analysis Handout M
UC Davis — Charles Martel May 2, 2008
Sample Midterm Exam
1 Short answers [40 points]
•(10) Part A. Solve the following recurrence by finding a Θ() bound for T(n). Assume
that T(n) is 1 for n≤1, and otherwise is defined by the recurrence.
T(n) = 15T(n/4) + 5n2+ 7n
•(15) Part B. For the closest point algorithm we discussed in class, suppose we knew
that every time we divide some number of points k, when we execute the combine step
(where we use the “strip” points which are within dof the dividing line) at most √k
points are within dof the dividing line.
– i) For this setting write a recurrence relation for W(n), the maximum number
of distance computations (where we compute the distance between two pairs of
points). DO NOT use big O notation. Try and give the constants as precisely as
you can. Note that you can ignore work other than distance computations.
– ii) Solve your recurrence to within Θ accuracy.
2 Short answers Midterm 2 version [40 points]
•(10) Part A. Solve the following recurrence by finding a Θ() bound for T(n). Assume
that T(n) is 1 for n≤1, and otherwise is defined by the recurrence.
T(n) = 15T(n/3) + 5n2+ 7n
•(15) Part B. For the closest point algorithm we discussed in class, suppose we knew
that every time we execute the combine step (where we use the “strip” points which
are within dof the dividing line) at most half the points are within dof the dividing
line.
– i) For this setting write a recurrence relation for W(n), the maximum number
of distance computations (where we compute the distance between two pairs of
points). DO NOT use big O notation. Try and give the constants as precisely as
you can. Note that you can ignore work other than distance computations.
– ii) Solve your recurrence to within Θ accuracy.