Essential cookies keep your basket and sign-in working. Optional cookies help us understand visits and measure ads. Privacy details.
A mathematical notation that describes the limiting behavior of a function when the argument tends towards infinity.
AI-assisted explanation. It may contain errors; use a textbook or original source to check important details.
Big‑O notation isn’t a single equation so much as a promise about growth. Imagine you’re timing an algorithm as the input size n gets larger and larger. The exact runtime might be something messy like 3n^2 + 10n + 50, but Big‑O asks: “What part of this dominates when n becomes huge?” In that example, eventually overwhelms the linear and constant pieces, so we say the algorithm is O(). Formally, writing f(n) = O(g(n)) means: beyond some sufficiently large input size, f(n) grows no faster than a constant multiple of g(n). In other words, there exist constants C > 0 and n0 such that for all n ≥ n0, f(n) ≤ C·g(n). The characters in this story are: - f(n): the thing you’re measuring (time, memory, comparisons, etc.). - g(n): a simpler “yardstick” function (like n, n log n, ). - C: the constant factor Big‑O chooses to ignore (machine speed, implementation details). - n0: the point after which the asymptotic behavior really settles in. The beauty of Big‑O is that it lets us compare algorithms by their shape of growth rather than their exact stopwatch time. It explains why an O(n log n) sorting method will eventually beat an O() method, even if the slower-growing one has a bigger constant overhead at small n.
Big‑O grew out of 19th‑century mathematics, where analysts needed a disciplined way to talk about “error terms” and asymptotic approximations—how close a truncated series or estimate is when variables get large. The symbol O(·) was introduced to make statements like “the remainder is bounded by a constant times this simpler function.” In the 20th century, computer science adopted Big‑O as the natural language for algorithm analysis. As algorithms became central to engineering and science, researchers needed a machine‑independent way to predict scalability: not “how fast on my computer today,” but “how does it behave as data sizes grow by 10×, 100×, 1,000×?” Big‑O became the headline descriptor because it captures the dominant growth and ignores details that don’t change the long-run story.
Pioneered by: Paul Bachmann is commonly credited with introducing Big‑O notation ("Bachmann–Landau notation"); it was later popularized and expanded by Edmund Landau.