Computer ScienceGeneralQuality 63 · Exceptional

Big-O Notation for Beginners

PR
Oona Johnson Verified Teacher
@author · 2026-07-07 · v1
7 min read
Big-O describes how runtime grows with input size.
O(1)O(1)
is constant (array access),
O(n)O(n)
is linear (looping once),
O(n2)O(n^2)
is quadratic (nested loops),
O(log⁡n)O(\log n)
halves work each step (binary search). It ignores constants and lower terms:
O(2n+5)O(2n + 5)
simplifies to
O(n)O(n)
.
0 teacher endorsements

Discussion

Comments support LaTeX — write ∫01x2 dx\int_0^1 x^2\,dx inline with $...$.

Sign in to join the discussion.

No comments yet

Be the first to share your thoughts.