Frage

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)?

War es hilfreich?

Lösung

...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)).

Andere Tipps

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))

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top