Chapter 9 - Growth Functions
Chapter 9 - Growth Functions
1
Sharad Chandra Joshi
2
Sharad Chandra Joshi
Big O notations are used to clarify running time function. If f(n) is O(g(n), then informally, f(n)
is within a constant factor of g(n).
Definition: Let f(n) and g(n) be two functions on positive integers. We say f(n) is O(g(n)) if there
exist two positive constants C and K such that f(n) <= C g(n) for all n >= K.
Example 1
Solution:
To show f(n) is O(g(n)), we must show constants C and k such that f(n) ≤ Cg(n) for all n ≥ k.
We are allowed to choose C and k to be integer, we want as long as they are positive.
Solving for n,
10n+5 ≤ 15n
Or, 5≤ 5n
Or, 1≤ n
3
Sharad Chandra Joshi
Example 2
Solution: