use*_*408 35 complexity-theory big-o time-complexity
证明
1 + 1/2 + 1/3 + ... + 1/n is O(log n).
Assume n = 2^k
Run Code Online (Sandbox Code Playgroud)
我把这个系列放到了总和中,但我不知道如何解决这个问题.任何帮助表示赞赏
chi*_*ngc 48
这很容易从微积分中的一个简单事实中得出:

我们有以下不等式:

在这里我们可以得出结论,S = 1 + 1/2 + ... + 1/n都是Ω(log(n))和O(log(n)),因此它是Ɵ(log(n)),绑定实际上很紧张.
| 归档时间: |
|
| 查看次数: |
32907 次 |
| 最近记录: |