{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

l21clintroalgo

# l21clintroalgo - Introduction to Algorithms 6.046J/18.401J...

This preview shows pages 1–10. Sign up to view the full content.

Introduction to Algorithms 6.046J/18.401J L ECTURE 2 Asymptotic Notation O -, -, and Θ -notation Recurrences Substitution method Iterating the recurrence Recursion tree Master method Prof. Charles E. Leiserson

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Asymptotic notation O -notation (upper bounds): We write f ( n ) = O ( g ( n )) if there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.2
Asymptotic notation O -notation (upper bounds): We write f ( n ) = O ( g ( n )) if there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . E XAMPLE : 2 n 2 = O ( n 3 ) ( c = 1 , n 0 = 2 ) © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Asymptotic notation O -notation (upper bounds): We write f ( n ) = O ( g ( n )) if there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . E XAMPLE : 2 n 2 = O ( n 3 ) ( c = 1 , n 0 = 2 ) functions, not values © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.4
Asymptotic notation O -notation (upper bounds): We write f ( n ) = O ( g ( n )) if there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 . E XAMPLE : 2 n 2 = O ( n 3 ) ( c = 1 , n 0 = 2 ) funny, “one-way” functions, equality not values © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Set definition of O-notation O ( g ( n )) = { f ( n ) : there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 } O ( g ( n )) = { f ( n ) : there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 } © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.6
Set definition of O-notation O ( g ( n )) = { f ( n ) : there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 } O ( g ( n )) = { f ( n ) : there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 } E XAMPLE : 2 n 2 O ( n 3 ) © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.7

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Set definition of O-notation O ( g ( n )) = { f ( n ) : there exist constants c > 0, n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 } O ( g ( n )) = { f ( n ) : there exist constants c > 0 , n 0 > 0 such that 0 f ( n ) cg ( n ) for all n n 0 } E XAMPLE : 2 n 2 O ( n 3 ) ( Logicians: λ n .2 n 2 O ( λ n . n 3 ) , but it’s convenient to be sloppy, as long as we understand what’s really going on.) © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.8
Macro substitution Convention: A set in a formula represents an anonymous function in the set.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern