Example: CN How Much Faster On Twice As Fast Computer? (2) How Much Longer For 2n?
Example: CN How Much Faster On Twice As Fast Computer? (2) How Much Longer For 2n?
2-1
Examples:
10n is O(n2)
since 10n 10n2 for n 1 or 10n n2 for n 10
c
n0
5n+20
isPearson
O(10n)
Copyright
2007
Addison-Wesley. All rights reserved.
2-2
2-3
2-4
Note the difference between the two recurrences. Students often confuse these!
F(n) = F(n-1) n
F(0) = 1
forthe
values
n!
Copyright
2007
Pearsonof
Addison-Wesley.
All rights reserved.
2-5