What does O(O(f(n))) mean?

三世轮回 提交于 2019-12-12 16:40:24

问题


I have the understanding about the Big-Oh notation. But how do I interpret what does O(O(f(n))) mean? Does it mean growth rate of the growth rate?


回答1:


x = O(n) basically means x <= kn for some constant k.

Thus x = O((O(n)) means x <= pO(n) for some constant p, which means x <= pqn for some constant q.

Let k = pq.

Then x = O((O(n)) = O(n).

In other words, O(O(f(n))) = O(f(n)).

I am curious, where did you see such notation being used?




回答2:


From a Big-Oh point of view:

g(n) = O(f(n)) means g(n) <= K*f(n) for some K (and after some n1)

But then h(n) = O(O(f(n)) would mean something like h(n) <= L * M * f(n) for some L, M, after some n > n1, n2.



来源:https://stackoverflow.com/questions/25838708/what-does-oofn-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!