COT5407-Class02

COT5407-Class02 - BigOhNotation 10,000 Givenfunctionsf(n)...

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

View Full Document Right Arrow Icon
  Analysis of Algorithms 1 © 2004 Goodrich, Tamassia Big-Oh Notation Given functions  f ( n ) and  g ( n ) , we say that  f ( n ) is  O ( g ( n ))  if there are  positive constants c  and  n 0  such that f ( n )     cg ( n ) for  n   n 0 Example:  2 n + 10  is  O ( n ) 2 n + 10   cn ( c - 2) n 10 n 10 / ( c - 2) Pick  c = 3 and  n 0 = 10 1 10 100 1,000 10,000 1 10 100 1,000 n 3n 2n+10 n
Background image of page 1

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

View Full DocumentRight Arrow Icon
  Analysis of Algorithms 2 © 2004 Goodrich, Tamassia Big-Oh Example Example: the function  n 2 is not  O ( n ) n 2   cn n   c The above inequality  cannot be satisfied  since  c  must be a  constant  1 10 100 1,000 10,000 100,000 1,000,000 1 10 100 1,000 n n^ 2 100n 10n n
Background image of page 2
  Analysis of Algorithms 3 © 2004 Goodrich, Tamassia More Big-Oh Examples 7n-2 7n-2 is O(n) need c > 0 and n 0    1 such that 7n-2   c•n for n   n 0 this is true for c = 7 and n
Background image of page 3

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

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

This note was uploaded on 09/13/2011 for the course COT 5407 taught by Professor Staff during the Spring '08 term at FIU.

Page1 / 6

COT5407-Class02 - BigOhNotation 10,000 Givenfunctionsf(n)...

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

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