简体   繁体   English

BigOh 和增长率有什么关系?

[英]What is the relationship between BigOh and growth rate?

What is the relationship between BigOh and growth rate? BigOh 和增长率有什么关系? Is the growth rate a feature of BigOh function 'O' ?增长率是 BigOh 函数 'O' 的特征吗?

BigOh just says, growth rate can not be greater than constant factor of growth rate of specific function, It can't show what is growth rate. BigOh 只是说,增长率不能大于特定函数增长率的常数因子,它不能表示什么是增长率。

Update更新

Assume f(n) = 2*f(n-1) + 1 and f(1) = 1, means f(n) = 2 n - 1, BigOh for this function can be:假设 f(n) = 2*f(n-1) + 1 和 f(1) = 1,意味着 f(n) = 2 n - 1,这个函数的 BigOh 可以是:

BigOh (f(n)) belongs to { 2 n , 2 n-100 , 2 2*n , 2 2 n , ...} but does not belong to {2 n/2 , n 2 , ....} BigOh (f(n)) 属于 { 2 n , 2 n-100 , 2 2*n , 2 2 n , ...} 但不属于 {2 n/2 , n 2 , ....}

As you can see functions like 2 2 n has very very fast growing rate, but it shows BigOh for 2 n .正如你所看到的,像 2 2 n这样的函数具有非常快的增长速度,但它显示了 2 n 的BigOh。

Some functions are incredible, and no one find exact speed of them, one of a best usages of BigOh is in this situations.有些功能令人难以置信,没有人发现它们的确切速度,BigOh 的最佳用法之一就是在这种情况下。

In fact when you can't determine θ It's good to find good BigOh, to frankly say my function (algorithm) is not slower than this function.其实当你不能确定 θ 的时候,找个好的 BigOh 就好了,坦白说我的函数(算法)不比这个函数慢。 So BigOh is valuable but again may be is very far from your function grows rate.所以 BigOh 是有价值的,但又可能离你的函数增长率很远。 BigOh is good for randomize algorithms also for deterministic complicated functions. BigOh 适用于随机化算法,也适用于确定性复杂函数。

据我所知,'O'增长率。

形式上,BigOh 和增长率的关系是http://en.wikipedia.org/wiki/Big_O_notation#Formal_definition

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM