在Big Theta表示法中,常量c1
和c2
对n
的每个值都有所不同吗?
定义:
Theta(g(n)) = {f(n): there exist c1 >= 0, c2 > 0 and n0 > 0
such that for all n >= n0,
0 <= c1, g(n) <= f(n) <= c2 * g(n)}
答案 0 :(得分:4)
c1
和c2
对于n
的每个值都没有区别。如果是,他们将依赖于n
,并且不会是常数。
答案 1 :(得分:1)
Theta(g(n)) = {f(n): for all n >= n0, there exist c1 >= 0, c2 > 0 and n0 > 0
such that 0 <= c1, g(n) <= f(n) <= c2 * g(n)}
我不认为你定义中的量词是正确的。它应该是
Theta(g(n)) = {f(n): there exist c1 >= 0, c2 > 0 and n0 > 0
such that for all n >= n0, c1 * g(n) <= f(n) <= c2 * g(n)}