Next: 1.2.3 An Example: Complexity of Mergesort
Up: 1.2 Complexity of Algorithms
Previous: 1.2.1 Big Oh Notation
- Let f(n) = n2 + n + 5. Then
- -
- f(n) is O(n2)
- -
- f(n) is O(n3)
- -
- f(n) is not O(n)
- Let f(n) = 3n
- -
- f(n) is O(4n)
- -
- f(n) is not O(2n)
- If f1(n) is O(g1(n))
and f2(n) is O(g2(n)), then
- -
- f1(n) + f2(n) is O(max(g1(n), g2(n)))
eEL,CSA_Dept,IISc,Bangalore