Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

What is the time complexity of, f(n)= n3+n2+n+4

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
n= 1
  • f(n) = Ω(g(n))
  • f(n) = Ω(n3)