"Big-O sounds like a fraternity. It's actually the least intimidating idea in computer science: if I double the data, what happens to the work?"
Strip the Scary Off It
People treat Big-O like a secret handshake. It isn't. The 'O' just means "on the order of" — a rough description of the growth shape, ignoring details that don't matter at scale. Every Big-O you'll ever meet answers a single question: when the input doubles, what happens to the amount of work?
That's it. Three of the most common answers tell you almost everything:
- O(1) — constant. Double the data, work stays the same. Looking up a word in a dict doesn't care if the dict has 10 entries or 10 million.
- O(n) — linear. Double the data, double the work. Reading every item in a list once.
- O(n²) — quadratic. Double the data, quadruple the work. Comparing every item to every other item.
The Doubling Test
Here's a trick that makes complexity physical instead of abstract. Take any function, run it on n items, then run it on 2n items, and watch what the work does:
- Work unchanged? O(1).
- Work doubled? O(n).
- Work × 4? O(n²).
- Work grew by just a fixed amount (one extra step)? O(log n) — the magical one we'll meet soon.
You can run this test in your head while reading code, or literally in a counter like the snippet below. Once doubling becomes a reflex, you read complexity straight off the page.
Why We Throw Away the Junk
Big-O deliberately ignores constants and small terms. An algorithm that does 2n + 7 steps is still O(n) — because when n hits a million, the 2 and the 7 are invisible next to the n. We're not being sloppy; we're focusing on the only thing that decides whether the code survives at scale: the dominant shape. (The next lesson shows you how to read that shape straight out of loops.)