算法导论 Exercise 3.1-3

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.

你可能感兴趣的:(算法导论)