Next:
Up:
Previous:
Analysis
T(n) = T(n-1) +
in the worst case
= cn + c(n-1) + c(n-2) + ... + c
=
=
=
T(n) = T(n/2) +
in the best case
a=1, b=2, f(n) =
,
= 1
Case 3: T(n) =
Show: 1*f(n/2)
cf(n), c
<
1
f(n/2)
c*f(n)
c
>=
1/2
Next:
Up:
Previous: