Computing Library › Glossary
Glossary

Big-O Notation

A notation describing how an algorithm's resource use grows with input size, ignoring constants.

Definition

Big-O notation describes the asymptotic upper bound on how an algorithm's running time or memory grows as the input size n grows. It discards constant factors and lower-order terms to capture the dominant scaling behavior.

Constants and lower-order terms, which big-O discards, can dominate at the modest input sizes real programs often face, so an asymptotically slower algorithm may win in practice. Asymptotic analysis guides the choice but should be confirmed by measurement on representative data.

Related notations complete the picture: big-Omega gives a lower bound and big-Theta a tight bound, so stating that a sort is Theta(n log n) says its cost grows exactly at that rate. Space complexity applies the same analysis to memory, which can matter more than time on large data. Used together, these tools let engineers predict and compare scaling behavior before writing a line of code.

Common classes

Why it matters

Big-O lets engineers compare algorithms independent of hardware and predict which will scale. The gap between O(n log n) and O(n^2) is small for tiny inputs but decisive at scale, which is why asymptotic analysis guides algorithm choice.

Fusion connection

Whether a plasma simulation scales as n, n log n, or n^2 in the number of grid cells determines what resolution is affordable, making complexity a practical design constraint at Kronos.