Skip to content
UPEEC

Master Theorem

Solves recurrences of the form $T(n) = aT(n/b) + f(n)$.

Advanced
Comments 0

Compare f(n)f(n) with nlog⁡ban^{\log_b a}: if ff is smaller → Θ(nlog⁡ba)\Theta(n^{\log_b a}); equal → Θ(nlog⁡balog⁡n)\Theta(n^{\log_b a}\log n); larger (with regularity) → Θ(f(n))\Theta(f(n)). Merge sort: a=b=2a=b=2, f=nf=n → Θ(nlog⁡n)\Theta(n\log n).

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.