2

whats is the big O notation of this function f(x) = logn + 3n i have ridden big o notation but i am confuse in this function so please help me

2 Answers2

2

It is simply O(n).

When you have a composite of multiple parts in big O notation which are added, you have to choose the biggest one. In this case it is O(3n), but there is no need to include constants inside parentheses, so we are left with O(n).

https://en.wikipedia.org/wiki/Big_O_notation

Islam Murtazaev
  • 1,488
  • 2
  • 17
  • 27
0

It's O(n).

Proof: lim n->inf f(n)/3n = lim n->inf (logn + 3n) / 3n = [0 + 1] = 1

so f(n) and 3n have the same asimptotic behavior

according to the "O" notation constants are dropped so f(n) is O(3n) = O(n)