Time Complexity
The time complexity of a function can be solved by using a 5 step process
Decrease and Conquer
Aims to reduce the problem to a single constant
- If base case, return directly.
- Reduce input to a smaller instance.
- Recursively solve the smaller instance.
- Extend/adapt that solution to solve the original.
Example
Find the time complexity of