Why Big-O Matters
In computer science, comparing runtime in milliseconds is unreliable because hardware speeds differ. Big-O notation characterizes the fundamental scaling behavior of an algorithm independent of hardware:
| Notation | Name | Typical Example |
|---|---|---|
| Constant Time | Hash table lookup | |
| Logarithmic Time | Binary search | |
| Linear Time | Linear array traversal | |
| Linearithmic Time | Merge Sort / Quick Sort | |
| Quadratic Time | Nested loops / Bubble sort | |
| Exponential Time | Recursive Fibonacci |