Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · DSA · The toolbox · about 16 min to read

Watch: Big-O: why the algorithm beats the hardware
▶ VideoPlay it as a journeyTutor comes with a plan

Complexity & Big-O

Complexity and Big-O
Complexity and Big-O · Open board

The ladder you’ll use for every data structure and algorithm that follows in this track, and it plugs straight into The Memory Hierarchy (cache, locality, the memory wall).

Before you start. You need to be able to multiply two numbers and read a simple table: that’s the whole of the maths in the story half. This is the first lesson in the DSA track, so there’s nothing earlier to recall. If a cache miss is new, it is just the processor reaching for something that is not close by and waiting for memory to fetch it.

Lesson 2 of 96 in DSA · Free with an account

Keep reading. It's free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

No card, and chalk sends no email. Google sign-in only.

Start free with Google

In this lesson

  • 1894: a mathematician needs a word for “grows about this fast”
  • 1976: the letter means three different things, so Knuth writes a letter
  • The idea: stop timing it, start counting the shape
  • The front-desk line: five shapes of getting slower

Terms it explains: O(1), O(log n), O(n), O(n²), O(2ⁿ), The dominant term wins, amortized, best/average/worst case, Big-O, dominant term, in-place, input-sensitive, linearithmic, Master theorem, memoization, the cache caveat, time vs space complexity, Θ (theta), Ω (omega).

Lab

A million items. O(n log n) finishes in a blink. How long does O(n²) take?

Drag Input size, n up to a million and watch the Off the chart panel count rungs that now read never.

Open How cost grows

Related paper

Review DSA