8.3 Divide-and-Conquer Algorithms and Recurrence Relations
8.3 Divide-and-Conquer Algorithms and Recurrence Relations
Suppose that f (n) = f (n/5) + 3n2 when n is a positive integer divisible by 5, and f (1) = 4. Find
a f (5).
b f (125).
c f (3125).
Give a big-O estimate for the function f (n) = f (n/2)+1 if f is an increasing function and n = 2k .
Give a big-O estimate for the function f (n) = 2f (n/3) + 4 if f is an increasing function and
n = 3k .
Suppose that the votes of n people for different candidates (where there can be more than two
candidates) for a particular office are the elements of a sequence. A person wins the election if this
person receives a majority of the votes.
b Use the master theorem to give a big-O estimate for the number of comparisons needed by
the algorithm you devised in part (a).