What is the time complexity of given function,
f(n)= n3+n2+n+4 ?
Solution:
Given,
f(n)= n3+n2+n+4
- f(n) >= n3+n2+n+4
- f(n) >= n3+n2+n, for all n>=1
- f(n) >= n3+n2 , for all n>=1
- f(n) >= n3, for all n>=1
Compare with the standard Big omega notation equation that is,
f(n)>=c*g(n), for all n0>=n
Here,
g(n) = n3,
c = 1
n0 = 1
- f(n) = Ω(g(n))
- f(n) = Ω(n3)
Post a Comment
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.