Questions: Analyzing Recursive Algorithms via Recurrence Relations

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

An algorithm splits a problem of size n into 3 subproblems of size n/3 and does O(n) work combining them. Using the master theorem with T(n) = aT(n/b) + O(n^d), what is the overall time complexity?

AO(n) — the combining work dominates
BO(n log n) — since log₃(3) = 1 = d, the work is balanced across levels
CO(n²) — three subproblems causes quadratic growth
DO(log n) — dividing into thirds accelerates convergence
Question 2 Multiple Choice

A student writes a recursive algorithm with the recurrence T(n) = T(n-1) + O(1). A classmate writes one with T(n) = T(n/2) + O(1). Which claim is correct?

ABoth are O(log n) since both make a single recursive call
BBoth are O(n) since both reduce the problem by a constant factor
CThe first is O(n) and the second is O(log n) — subtracting 1 vs dividing by 2 differs dramatically
DThe first is O(n log n) because n levels each require O(log n) overhead
Question 3 True / False

A recurrence relation for an algorithm must include a base case to be well-defined, but the base case does not affect the asymptotic complexity.

TTrue
FFalse
Question 4 True / False

In the recursion tree for merge sort T(n) = 2T(n/2) + O(n), the total work at every level of the tree is O(n), and there are O(log n) levels, giving O(n log n) overall.

TTrue
FFalse
Question 5 Short Answer

Why is correctly setting up the recurrence relation — identifying a, b, and the non-recursive work — the most important step in analyzing a recursive algorithm, rather than the choice of solving technique?

Think about your answer, then reveal below.