Next:
Changing Variables
Up:
CSE 2320: Algorithms and
Previous:
Example:
Now let's try subtracting a lower-order term:
We know cn - b
O(n).
Guess:
?
T(n) = O(n)
Show:
?
T(n) <= cn - b
Assume:
?
T(n/2) <= cn/2 - b
T(n) = 2T(n/2) + 1
T(n)
2(cn/2 - b) + 1
= cn - 2b + 1
cn - b
True if b - 1
0, b
1 (okay)
Copyright © 1998 The University of Texas at Arlington