l21clintroalgo

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

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 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 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 . 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 . © 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 . 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 . 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 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 . 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 . 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 . 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 . 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 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 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 ) ≤...
View Full Document

This note was uploaded on 11/07/2011 for the course AERO 16.410 taught by Professor Brianwilliams during the Fall '05 term at MIT.

Page1 / 55

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

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

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