Module M03 · 3 of 35 in teaching order · Beginner

Big O

Count operations, describe growth, and tell worst-case, average and amortized costs apart.

Lessons

  1. Count basic operations, keep the leading term, and state it with O, Θ or Ω. The common growth classes, the rules for loops, and what Big O hides.

  2. Which inputs a bound is about: best, worst and average case, expected cost of randomized code, and amortized cost over a sequence, with dynamic array appends.

  3. Auxiliary vs total space, why recursion depth is memory, in-place algorithms, time-space trade-offs, and bounds with several size variables such as O(n + m).

Topics this module covers

The full module scope. Topics without a lesson above are not written yet.

  • operation counting
  • input size
  • O/Theta/Omega
  • constant/logarithmic/linear/n log n/quadratic/cubic/exponential/factorial
  • best/average/worst
  • auxiliary space
  • amortized
  • multiple inputs
  • loops
  • recursion introduction

Builds toward