

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


University of South Carolina
01/26/2009 2
01/26/2009 3
In some cases a single operation may be
expensive, but the total time for an entire
sequence of n operations is significantly better
than n * (worst case efficiency of that single
operation)
Similar to businesses amortizing an expensive item
over its productive lifetime
01/26/2009 4
Both time and space efficiencies are measured as
Efficiencies of some algorithms may differ
significantly for different inputs of same size
algorithm’s running time/extra memory units
consumed as its input size goes to infinity
01/26/2009 5
01/26/2009 6
01/26/2009 7
01/26/2009 8
01/26/2009 9
0
0
Examples:
2
)
01/26/2009 10
1
1
2
2
1
2
1
2
01/26/2009 11
lim n→∞
T(n)/g(n) =
0 order of growth of T ( n ) ___ order of growth of g ( n )
c >0 order of growth of T ( n ) ___ order of growth of g ( n )
∞ order of growth of T ( n ) ___ order of growth of g ( n )
Examples: Examples:
2
2
b
n vs. log
c
n (b>c> 1 )
01/26/2009 12
n→∞
n→∞
1/
n
f
f (
n
n )
g
g (
n
n )
lim lim
n
n →∞
→∞
f
f ´
n
n )
g
g ´
n
n )
limlim
n
n →∞
→∞
Example: log
2
n vs. n
1/
Example: n! vs. 2
n