Question

I'm trying to determine whether it is: O(1). How can I prove it? In complexity terms, log_b(n) is log(n). So is O(log_2(n)-log_3(n))=O(0)=O(1)? that doesn't seem like a strong proof. Also, this doesn't converge asymptotically, so how can it be O(1)?

Était-ce utile?

La solution

...your proof is wrong. O(log_2(n)-log_3(n))==O(log(n)/log(2)-log(n)/log(3))==O(log(n)*(1/log(2)-1/log(3))=O(Clog(n))=O(log(n)).

Autres conseils

Also, you might have a look at Wolfram Alpha

It gives some nice plots for log_2(n)-log_3(n)

And, even more important for you, it describes O(log_2(n)-log_3(n))

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top