next up previous
Next: Example: Factorial Up: l2 Previous: Solution Techniques

Note

The ith term of the series (i starts at 0) is \(2^i T(n/2^i)\). The series ends when we hit T(1), or \(n/2^i \;=\; 1 \;\longrightarrow\;
n \;=\; 2^i \;\longrightarrow\; i \;=\; lg n\).

T(n) = n + n + n + ... + \(2^{lg n} T(1)\)
= n + n + n + ... + nT(1)
= \( \sum_{i=0}^{lg n - 1} n \) + nT(1)
= nlgn + n$\Theta(1)$
= nlgn + $\Theta(n)$
= nlgn + $o(nlgn)$
= $\Theta(nlgn)$



Do not simplify asymptotic expressions until there is no summation in the expression.


next up previous
Next: Example: Factorial Up: l2 Previous: Solution Techniques