Why is it a misconception that Big-O notation means worst-case running time?
answer
- two independent axes are being conflated
- case picks the function, notation bounds it
- worst case can have a lower bound too
- best case Omega(n) is meaningful
basics
~20 sBig-O bounds the growth of a function; the case — best, worst, average — chooses which function you bound. They are independent axes: a worst case can have O, Theta, and Omega bounds, and a best case can meaningfully be Omega(n).
solid answer
~50 sNotation and case are orthogonal. For a given algorithm you can define several running-time functions of n: the worst case (maximum time over all inputs of size n), the best case (minimum), the average case (expectation over a distribution). Each is just a function, and each can be given upper bounds (O), lower bounds (Ω), or tight bounds (Θ). So "worst case Θ(n^2)" and "best case Ω(n)" are both well-formed — the latter says even the most favorable input needs at least linear time, true of any algorithm that always examines every record. The conflation arises from convention: an unqualified "the algorithm is O(n log n)" usually means "worst case is O(n log n)", because an upper bound on the worst case covers every input and is the strongest simple guarantee. But 'O = worst, Ω = best' as a definition is wrong.
go deeper
Be ready to say that best, worst, and average case describe different inputs, and that Big-O is a bound you can put on any of them. If you've memorized 'O = worst case', flag it to yourself as a shorthand, not a definition.
An interviewer expects the clean two-axis picture: case selects the function, notation bounds it, and every combination is meaningful. Producing and explaining a statement like 'best case Omega(n)' on demand is the test.
Show why the separation matters in practice: guarantees to callers are worst-case upper bounds, slowness arguments need lower bounds with witness inputs, and a claimed tight bound should make you ask which case it characterizes.
Own the standard for performance claims in design docs: every stated bound names its case and its direction. Ambiguous claims like 'this path is O(n)' are where capacity-planning mistakes hide, and the fix is vocabulary, not tooling.
## Two independent axes Most complexity statements involve two separate choices that the folklore phrase "Big-O is worst case" collapses into one: 1. **Which function are we talking about?** An algorithm doesn't have one running time — it has a running time *per input*. To get a function of the input *size* n, you must aggregate over all inputs of that size: take the maximum (**worst case**), the minimum (**best case**), or the expectation under some distribution (**average case**). Each choice yields an ordinary function of n. 2. **What kind of bound are we stating about it?** Upper (**O**), lower (**Ω**), or tight (**Θ**). Any combination is legitimate, giving a 3-by-3 grid of meaningful statements. "Worst case is O(n^2)": no input costs more than quadratic. "Worst case is Ω(n^2)": some family of inputs forces quadratic. Both together: "worst case is Θ(n^2)" — the standard complete characterization of an algorithm's worst behavior. "Best case is Ω(n)": even the most favorable input costs at least linear time. ## Making 'best case Ω(n)' concrete Consider a validation pass that must inspect every one of n product records to confirm each has a well-formed key — it never exits early, because a clean record tells it nothing about the others it hasn't read. Its most favorable input still costs a full scan, so the honest statement is: *best case Ω(n)* (indeed Θ(n)). A candidate who believes "Ω means best case" tends to parse "best case Ω(n)" as redundant or contradictory; a candidate who has separated the axes reads it instantly as "even at its luckiest, it's at least linear". Contrast an early-exit search that returns on the first record matching a target key: its best case (match in position one) is Θ(1), while its worst case (no match) is Θ(n). Same algorithm, different case functions, each with its own tight bound — the grid in action. ## Where the conflation comes from The folklore isn't random; it fossilizes two real conventions: - **Unqualified O-statements default to worst case.** When someone says "this algorithm is O(n log n)" with no case named, they conventionally mean the worst case is O(n log n). That's the natural default because a worst-case upper bound covers *every* input — it is the strongest guarantee expressible with one simple claim, and guarantees are what callers want. - **Ω appears most often in lower-bound results**, which are frequently proved via hard instances, and hard instances feel "worst-case-ish". But the notation itself is case-agnostic. So the shorthand is defensible; promoting it to a definition is the error. The tell in an interview is whether the candidate can *generate* a statement like "best case Ω(n)" and explain what it asserts, rather than pattern-matching O to worst and Ω to best. ## Why the distinction earns its keep Precision here changes what you can conclude. "Worst case O(n^2)" alone leaves open that the algorithm is actually linear on every input (the bound may be loose). Adding "worst case Ω(n^2)" — a witness family of inputs forcing quadratic work — closes the gap and pins the worst case at Θ(n^2). Conversely, best-case lower bounds are how you argue an algorithm *cannot* be made to exit early: if every run must read all the input it touches, no amount of cleverness inside that algorithm gets below linear. Keeping "which case" and "which bound" as separate slots is what lets these arguments be stated — and checked — cleanly.
- What does 'the worst case is Ω(n^2)' add over 'the worst case is O(n^2)'?The O-statement alone allows the bound to be loose — the algorithm might actually be linear on every input. The Ω-statement supplies a witness: some family of inputs really does force quadratic work. Together they pin the worst case at Θ(n^2), a complete characterization rather than a one-sided guarantee.
- When someone says 'the algorithm is O(n log n)' with no case mentioned, what is conventionally meant?Worst case. An upper bound on the worst case covers all inputs, making it the strongest simple guarantee — which is why it became the default reading. That convention is also exactly why the 'O means worst case' conflation feels natural: the shorthand is fine, but it is a usage default, not the definition of the notation.
The bound is the comparison operator — at most, at least, exactly — and the case is which scenario you measure. Saying 'O means worst case' is like saying 'less-than-or-equal means rainy days'.
saying these in an interview costs you the question
- Recites 'O is worst case, Omega is best case' as a definition
- Thinks 'best case Omega(n)' is redundant or contradictory
- Cannot separate which input is measured from how the bound is stated