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

What is the time complexity of given function? 
f(n)=n+4.

Solution:

Given,

f(n)=n+4 
  • n+4 >= n+4
  • n+4 >= n, where n >= 1
  • n+4 >= n, for all n>=1
f(n) >= n, 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) = n, 
c = 1
n0 = 1
  • f(n)=Ω(g(n))
  • f(n)=Ω(n) 
Share:

Post a Comment

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.