Big O notation describes how an algorithm's time or space requirements grow as input size (n) grows. It gives an upper bound on complexity.
**Common complexities (best → worst):** - **O(1)** — Constant: array index lookup - **O(log n)** — Logarithmic: binary search - **O(n)** — Linear: iterating an array - **O(n log n)** — Linearithmic: merge sort, quicksort (avg) - **O(n²)** — Quadratic: nested loops, bubble sort - **O(2ⁿ)** — Exponential: recursive fibonacci
Key insight: Big O ignores constants and lower-order terms. O(3n + 100) simplifies to O(n).