Page 1 of 1

algorithm

PostPosted: Fri Jan 15, 2016 7:11 pm
by SUMEDHADEY
f(n)=n^3,if 0<=n<=10000 and n^2 otherwise;g(n)=n,if 0<=n<100 and n^2+5n otherwise;then which is true?
a) f(n) is O(n^3)
b) g(n) is O(n^3)
c) O(f(n))=O(g(n))
d) g(n)= O(n^2)
given answer is option b).can anyone please explain?