Master Theorem

Let T:NR+T : \N \Rightarrow \R^+ be a function. Suppose that:

T(n)=T(n) =
11 if n=1n=1
aT(n/b)+nda\cdot T(n/b) + n^d if n>1n > 1

where a1,b>1a \geq 1, b > 1 and d0d \geq 0.

  • If d>logb(a)d > \log_b (a), then T(n)=O(nd)T(n) = O (n^d)
  • If d=logb(a)d = \log_b (a), then T(n)=O(ndlog(n))T(n) = O (n^d \log(n))
  • If d<logb(a)d < \log_b (a), then T(n)=O(n]logb(a))T(n) = O (n^{]log_b (a)})