我知道这严格来说不是一个编程问题,但它is一个计算机科学问题,所以我希望有人能帮助我。
I've been working on my Algorithms homework and figuring out the Big-Oh, Big-Omega, Theta, etc, of several algorithms. I'm proving them by finding their C and N0 values and all is going well.
然而,我遇到了该集中的最后两个问题,并且我正在努力弄清楚如何解决它们(谷歌并没有多大帮助)。
我以前不需要计算出总和的大哦/欧米茄。
我的最后两个问题是:
- Show that Σ (i=1 to n) of i2 is O(N3)
and
- Show that Σ (i=1 to n) of [log2i] is Ω(n log n)
我的问题是,我该如何证明这一点?
For example, in the first one, intuitively I can't see how that summation of i2 is O(N3). The second one confuses me even more. Can someone explain how to show the Big-Oh and and Big-Omega of these summations?
My guess is that what the question statement means is if you're summing the results of some calculation for which the running time is proportional to i2 in the first case, and proportional to log2i in the second case. In both cases, the running time of the overall summation is "dominated" by the larger values of N within the summation, and thus the overall big-O evaluation of both will be N*O(f) where f is the function you're summing.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)