lecture_02

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

Info iconThis 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 Prof. Charles E. Leiserson L ECTURE 2 Asymptotic Notation O -, -, and Θ -notation Recurrences Substitution method Iterating the recurrence Recursion tree Master method
Background image of page 1

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

View Full DocumentRight Arrow Icon
September 13, 2004 Introduction to Algorithms L2.2 Asymptotic notation 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 . O -notation (upper bounds): © 2001–4 by Charles E. Leiserson
Background image of page 2
September 13, 2004 Introduction to Algorithms L2.3 Asymptotic notation 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 . O -notation (upper bounds): E XAMPLE : 2 n 2 = O ( n 3 ) ( c = 1 , n 0 = 2 ) © 2001–4 by Charles E. Leiserson
Background image of page 3

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

View Full DocumentRight Arrow Icon
September 13, 2004 Introduction to Algorithms L2.4 Asymptotic notation 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 . O -notation (upper bounds): E XAMPLE : 2 n 2 = O ( n 3 ) functions, not values ( c = 1 , n 0 = 2 ) © 2001–4 by Charles E. Leiserson
Background image of page 4
September 13, 2004 Introduction to Algorithms L2.5 Asymptotic notation 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 . O -notation (upper bounds): E XAMPLE : 2 n 2 = O ( n 3 ) functions, not values funny, “one-way” equality ( c = 1 , n 0 = 2 ) © 2001–4 by Charles E. Leiserson
Background image of page 5

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

View Full DocumentRight Arrow Icon
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 } © 2001–4 by Charles E. Leiserson
Background image of page 6
September 13, 2004 Introduction to Algorithms L2.7 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
Background image of page 7

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

View Full DocumentRight Arrow Icon
September 13, 2004 Introduction to Algorithms L2.8 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
Background image of page 8
September 13, 2004 Introduction to Algorithms L2.9 Macro substitution Convention: A set in a formula represents an anonymous function in the set.
Background image of page 9

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

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

This note was uploaded on 04/10/2008 for the course CSE 6.046J/18. taught by Professor Piotrindykandcharlese.leiserson during the Fall '04 term at MIT.

Page1 / 55

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

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online