0% found this document useful (0 votes)
43 views

Example: CN How Much Faster On Twice As Fast Computer? (2) How Much Longer For 2n?

for analysis of algorithm

Uploaded by

prachi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Example: CN How Much Faster On Twice As Fast Computer? (2) How Much Longer For 2n?

for analysis of algorithm

Uploaded by

prachi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Example: cn2

Copyright 2007 Pearson Addison-Wesley. All rights reserved.

A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. 2

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.

A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. 2

2-2

Copyright 2007 Pearson Addison-Wesley. All rights reserved.

A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. 2

2-3

Copyright 2007 Pearson Addison-Wesley. All rights reserved.

A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. 2

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.

A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. 2

2-5

You might also like