When we analyze sorting algorithms, we care about how their execution time scales with input size \(n\).
We express this using Big-O notation, which describes the worst-case growth rate:
- \(O(n^2)\) — quadratic (Bubble Sort, Insertion Sort)
- \(O(n \log n)\) — log-linear (Merge Sort, Quick Sort)
- \(O(n)\) — linear (Counting Sort, special cases)
The goal: find algorithms that stay fast as \(n\) grows large.