Reputation: 35
I saw the following equivalence in the lowest common ancestor problem:
but I don't understand why, so I want to figure out how to prove:
Upvotes: 1
Views: 2238
Reputation: 2004
As explained by @Joni, you can prove that log(N)^2 < 16 * sqrt(N)
, which gives the expected big-O notation.
But you might be troubled because this equal sign is a "one way" one:
O(log(N)^2) = O(sqrt(N))
is true, but
O(sqrt(N)) = O(log(N)^2)
is false!
Upvotes: 1