### algorithm

Posted:

**Fri Jan 15, 2016 7:11 pm**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?

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?