Definition
Function r has order of growth if there are positive constants and and a number such that for all

Explanation
- Specifies the asymptotic bounds (both upper and lower) for a function
- Can be thought of as the average time/space complexity of an algorithm
For CS1101s
- Identify the basic computational steps
- Can be thought of as number of function calls in the case of recursive functions (not recursive processes)
- Try a few small values
- Extrapolate
- Watch out for βworst caseβ scenarios
- We do not necessarily need to include these scenarios due to
Some Examples
| Function | Time Complexity | Space Complexity |
|---|---|---|
| factorial (recursive) | ||
| factorial (iterative) | ||
| fibonacci (recursive) | ||
| fibonacci (iterative) | ? | ? |