In IS, the constant steps is step 1 and there are two while loops. Then we need to estimate the maximum steps would take for IS.
And the definition of big-oh notation is: f(n) = O(g(n)) means there are positive constants c and k, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ k. The values of c and k must be fixed for the function f and must not depend on n.
没有评论:
发表评论