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

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top