Goal: Understand how the runtime of an algorithm is affected by an increasing number of elements.
- Analyze the worst case performance of the algorithm, i.e. Big O
- Add steps in order (+); multiply nested steps (*)
- Different inputs should have different variables, e.g. O(a+b)
- Remove constants
- Drop non-dominants
O(1) – Constant
O(log n) – Logarithmic
O(n) – Linear
O(n * log n) – Log Linear
O(n^2) – Quadratic
O(2^n) – Exponential
O(n!) – Factorial