Skip to content
Infinitesimal Dynamics home
Notebook: 0 XP

Discrete Mathematics / Further counting, graphs and algorithms

Growth Rates and Big-O

How to say an algorithm is fast: comparing functions by how they grow, ignoring constants.

3 min read · 1 sections · 2 checks

Contents 2 sections
  1. §1Ignoring constants
  2. ?Check yourself

By the end you can

  • Define OO, Ω\Omega and Θ\Theta
  • Rank common growth rates
  • Analyse simple loops and divide-and-conquer recurrences

Helps to know: Recurrence Relations

§1Ignoring constants

1≺log⁡n≺n≺nlog⁡n≺n2≺2n≺n!1 \prec \log n \prec n \prec n\log n \prec n^2 \prec 2^n \prec n!

Binary search halves its problem each step: T(n)=T(n/2)+1T(n) = T(n/2) + 1 gives O(log⁡n)O(\log n). Merge sort solves two halves and merges: T(n)=2T(n/2)+nT(n) = 2T(n/2) + n gives O(nlog⁡n)O(n \log n).

Check yourself

  1. Q1
    3n2+50n+73n^2 + 50n + 7 is…
  2. Q2
    Which grows fastest?