So, clearly, log(n)
is O(n)
. But, what about (log(n))^2
? What about sqrt(n)
or log(n)
—what bounds what?
There's a family of comparisons like this:
nᵃ (vs.) (log(n))ᵇ
I run into these comparisons a lot, and I've never come up with a good way to solve them. Hints for tactics for solving the general case?
[EDIT: I'm not talking about the computational complexity of calculating the values of these functions. I'm talking about the functions themselves. E.g., f(n) = n
is an upper bound on g(n) = log(n)
because f(n) ≤ c g(n)
for c = 1
and n₀ > 0
.]