Practice Discrete Math

Algorithms / Recurrence Analysis

Least You Need to Know: Recursion Trees and Recurrence Intuition

Recurrences describe recursive runtime by combining the cost of smaller subproblems with the non-recursive work done at each step. Recursion trees help you see branching, depth, and total work level by level.

The least you need to know

Key notation

T(n) runtime on input size n
T(n)=2T(n/2)+n two half-size calls plus linear combine work
level cost total work across one recursion-tree layer

Tiny worked example

  • Merge sort satisfies `T(n)=2T(n/2)+n`.
  • Each level of the recursion tree touches all `n` items overall.
  • With about `log n` levels, the total becomes `Θ(n log n)`.

Common mistakes

How to recognize this kind of problem

Start practice