⚖️ The price tag: Big-O intuition
Why: Learn the professionals' shorthand for algorithm cost — and earn your Big-O intuition.
Unlocks: Every algorithms conversation, interview and textbook from here on.
You've now felt three growth speeds with your own hands. Professionals compress that feeling into a shorthand — Big-O notation — which answers exactly one question: when the input grows, how fast does the work grow? Not "how many milliseconds" — machines differ — but the shape of the growth.
| Name | Written | You met it in | 1,000,000 items ≈ |
|---|---|---|---|
| Constant | O(1) | Gauss's formula | 3 operations |
| Logarithmic | O(log n) | Binary search | 20 steps |
| Linear | O(n) | Linear search | 1,000,000 steps |
| Quadratic | O(n²) | Bubble sort | 1,000,000,000,000 steps |
Feel the cliff between the rows: on a million items, the gap between O(log n) and O(n²) is the gap between instant and days. No hardware upgrade crosses that cliff — only a better recipe does. Count steps yourself:
Your code checks every PAIR of users to find duplicates. With n users, what's its shape?
An interviewer asks: "Your O(n) solution takes 2 seconds on this machine. On a machine twice as fast, with 10× the data, roughly how long?"
The deepest lesson of this course, in one line:
🎓 Course complete. You can now read the price tag on any recipe. Next stops on the roadmap: practice these on real problems in the Playground, or go under the hood with PyDebug.