Recurrences Slides
Recurrences Slides
Recurrences Slides
1 2
3 4
The Master Method Master Method: Examples
log a log 1
if f n n then T n nlog a lg n f n lg n
log a
b b a=1, b=2/3, f(n)=1 n b n 32
log a
if f n n b
for some ε>0 and if af(n/b)≤cf(n) for Case 2, we conclude T(n)=Θ(lg n).
some c<1 then T n f n
T(n)=3T(n/4)+nlgn n
log b a
n O n 0.793
log 4 3
Case 3?
f(n)=nlgn is not polynomially larger than n: no ε>0
+tree: b
j 0
a f n b
nd
bound the 2 term with 3 cases (as in the theorem)
such that nlgn=Ω(n1+ε). (lemma 4.3)
We cannot apply the master theorem. evaluate the sum (asymptotically) using lemma 4.3.
Extend the proof for any n.
7 8