Semicolony ELI5 · comic

Big-O notation.

Not how fast something is today, but how the work grows as the line gets longer.

  1. They’re basically the same?
    small input — who can tell? n = 4
    1

    On a tiny input every approach looks fine — the piles are all small.

  2. n=1 n=1M O(1) flat, forever
    2

    O(1): the pile never grows. A lookup by position costs the same at any size.

  3. O(log n) halves each step
    3

    O(log n): the pile barely creeps up. Each step halves what’s left (binary search).

  4. O(n) double = double
    4

    O(n): double the input, double the pile. A straight scan of the list.

  5. It’s off the chart!
    O(n²) off the chart
    5

    O(n²): the pile explodes. A loop inside a loop — 1k items ≈ a million steps.

  6. O(1) ✓ O(log n) ✓ O(n) O(n²) ✗ big n — who’s left standing
    6

    On real, large data only the slow-growing shapes are still standing.

It’s not the size of the pile today — it’s how fast it grows as the line gets longer.
Semicolony semicolony.dev/eli5/big-o/comic
← All ELI5 explainers