算法导论 Exercise 3.1-3

来源:互联网 发布:mac不能上网 编辑:程序博客网 时间:2024/05/16 12:35

Explain why the statement, "The running time of algorithm A is at least O(n2)," is meaningless.

 

Let the running time be T (n). T (n) O(n2) means that T (n) f (n) for some

function f (n) in the set O(n2). This statement holds for any running time T (n),

since the function g(n) = 0 for all n is in O(n2), and running times are always

nonnegative. Thus, the statement tells us nothing about the running time.

原创粉丝点击