Big O Notation Solved Examples
Big O Notation Solved Examples (a) f ( n ) = 100 n 3 - 7 n 3 + 14 n 2 Solution: f(n)=93n 3 +14n 2 after removing all constants and lower order terms =O(n 3) (b) f ( n ) = 100 n 3 - 100 n 3 + 7 n 2 Solution: f(n)= 100n 3 - 100n 3 +7n 2 f(n)=7n 2 after removing all constants and lower order terms =O(n 2 ) (c) f ( n ) = log(7 n 2 ) Solution: f(n)=log(7n 2 ) after removing all constants and lower order terms =log(n) (d) f(n) = 5 log log n + 4 log 2 (n) Solution: f(n)=5loglogn+4log 2 (n) after removing all constants and lower order terms =O (log 2 n ) (e) f ( n ) = . 001 n + 100 · 2 n Solution: f(n)=.001n+100 · 2 n after removing all constants and lower order terms =O (2 n ) (f) f ( n ) = n 3 (1 + 6 n + 2014 n 2 ) Solution: f(n)=n 3 +6n 4 +2014n 5 after removing all constants and lower order terms =O ( n 5 ) (g) f ( n ) = (log ...
Comments
Post a Comment