This preview shows pages 1–9. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full 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 Onotation (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 Onotation (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 Onotation (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 Onotation (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, “oneway” functions, equality not values © 2001–4 by Charles E. Leiserson September 13, 2004 Introduction to Algorithms L2.5 Set definition of Onotation 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 Onotation 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 Onotation 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.
 Fall '05
 BrianWilliams

Click to edit the document details