简体   繁体   English

上限和下限是什么意思?

[英]What do upper bound and lower bound mean?

I am confused with upper and lower bound in algorithm complexity.我对算法复杂性的上限和下限感到困惑。 For example, if 𝑇(𝑛)=𝑂(2𝑛), 𝑇(𝑛)=Ω(𝑛^-1).例如,如果𝑇(𝑛)=𝑂(2𝑛),𝑇(𝑛)=Ω(𝑛^-1)。 Can I say that there always exists n^-1≤T(n)≤2n ?我可以说总是存在 n^-1≤T(n)≤2n 吗?

No, you cannot draw this conclusion.不,你不能得出这个结论。 The correct statement is that there exist constants C1, C2 > 0 such that for large enough n (n > some constant n0)正确的说法是存在常数 C1, C2 > 0 使得对于足够大的 n (n > 某个常数 n0)

C1 * (n^-1) ≤ T(n) ≤ C2 * n

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

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