{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 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
Image of page 3

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

View Full Document Right Arrow Icon
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
Image of page 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
Image of page 5

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

View Full Document Right Arrow Icon
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
Image of page 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
Image of page 7

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

View Full Document Right Arrow Icon
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
Image of page 8
Macro substitution Convention: A set in a formula represents an anonymous function in the set.
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern