困惑于是否EX preSS与THETA符号或大哦符号的时间复杂度符号、复杂度、困惑、时间

2023-09-11 23:09:15 作者:繁华散尽终成回忆

如何决定算法的前pressing时间复杂度?

How to decide on expressing time complexity of algorithm ?

如果我们选择EX preSS的时间复杂度 O(N) THETA(N)?因为一个函数 F(N)可以pssed因为无论是大哦(G(N)) THETA(G(N))

Should we choose to express time complexity in terms of O(n) or theta(n) ? Because a function f(n) can be expressed as either Big-Oh(g(n)) or theta (g(n)).

我们什么时候选择大哦了THETA?

When do we choose big-oh over theta ?

推荐答案

当你要同时指定一个下界使用大西塔符号。 F(N)= O(G(N))表示, F 上面用先按g ,而 F(N)=西塔(G(N))表示, F 先按g 界的上方和下方。

Use Big Theta notation when you want to also specify a lower bound. f(n) = O(g(n)) says that f is bounded above by g, whereas f(n) = Theta(g(n)) says that f is bounded both above and below by g.

在换句话说,有常数 K1 2 ,使得 K1 * | G(N)| < = | F(N)| < = K2 * | G(N)|

In other words, there are constants k1 and k2 such that k1 * |g(n)| <= |f(n)| <= k2 * |g(n)|