[prev] 33 [next]

Asymptotic Analysis of Algorithms

Asymptotic analysis of algorithms determines running time in big-Oh notation:
  • find worst-case number of primitive operations as a function of input size
  • express this function using big-Oh notation
Example:
  • algorithm arrayMax executes at most 5n – 2 primitive operations
    ⇒  algorithm arrayMax "runs in O(n) time"
Constant factors and lower-order terms eventually dropped
⇒ can disregard them when counting primitive operations