the time complexity of an algorithm is given by n^2/log(n). what is that in big O notation? Just n^2 or we keep the log?
Asked
Active
Viewed 714 times
0
-
Well `O(n^2)` _is_ an upper bound, but it is not the tightest upper bound. The tightest upper bound is what you already have, `O(n^2/logn)`. – Tim Biegeleisen May 18 '19 at 14:39
-
One of the big ohs to which `f(x)` is always belongs is `O(f(x))`. – Willem Van Onsem May 18 '19 at 14:44
1 Answers
0
As n^2 / (n^2/log(n))
goes to inifinity when n
grows, so, n^2/log(n) = o(n^2)
(little-oh). Therefore, n^2/log(n)
is not equivalent to n^2
.

OmG
- 18,337
- 10
- 57
- 90