根据这本书,大O的意思是:
f(n) = O(g(n)) means c · g(n) is an upper bound on f(n). Thus there exists some constant c such that f(n) is always ≤ c · g(n), for large enough n (i.e. , n ≥ n0 for some constant n0).
我无法理解下面的大 O 方程
3n2 − 100n + 6 = O(n2),因为我选择 c = 3 并且 3n2 > 3n2 − 100n + 6;
3怎么能成为因数呢?在 3n2 − 100n + 6 中,如果我们去掉低阶项 -100n 和 6,3n2 和 3.n2 不是一样吗?如何解这个方程?
我将冒昧地稍微解释一下这个问题:
Why do and have the same asymptotic complexity.
为了做到这一点,定义应该是双向的。
First:
let
Then for the inequality is always satisfied.
The other way around:
let
We have a parabola opened upwards, therefore there is again some after which the inequality is always satisfied.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)