Master the recursive paradigm of breaking problems into smaller subproblems, solving them independently, and combining their solutions. Learn the Master Theorem and analyze recursive algorithms.
Break the problem into smaller subproblems of the same type
Solve subproblems recursively (base case solves directly)
Merge solutions of subproblems to solve original problem
Merge sort, Quick sort, Binary search
Matrix multiplication, FFT, Karatsuba
Closest pair, Convex hull, Voronoi diagram
Maximum subarray, Selection problems
T(n) = a·T(n/b) + f(n)
where a ≥ 1, b > 1, and f(n) is asymptotically positive
f(n) = O(n^(log_b(a) - ε)) for some ε > 0
T(n) = Θ(n^(log_b(a)))
T(n) = 2T(n/2) + O(1) → T(n) = Θ(n)
Work is dominated by leaves of recursion tree
f(n) = Θ(n^(log_b(a)) × log^k(n)) for some k ≥ 0
T(n) = Θ(n^(log_b(a)) × log^(k+1)(n))
T(n) = 2T(n/2) + O(n) → T(n) = Θ(n log n)
Work is balanced between levels
f(n) = Ω(n^(log_b(a) + ε)) and regularity condition
T(n) = Θ(f(n))
T(n) = 2T(n/2) + O(n^2) → T(n) = Θ(n^2)
Work is dominated by root of recursion tree