Complexity Analysis of divide and conquer Law
We can see from the general design mode of the division and control method thatProgramIt is generally a recursive process. Therefore, the calculation efficiency of the divide and conquer method can usually be analyzed using recursive equations. For convenience, set the decomposition threshold N0 = 1, andAlgorithmWhen the ADHOC solution scale is 1, it takes one unit of time. It also sets up the division and control law to divide the problem of N into k subproblems of N/m. Moreover, splitting the original problem into k subproblems and merging the solutions of K subproblems with the algorithm merge requires F (n) units of time. If T (n) is used to represent the calculation time required for the divide-and-conquer (p) solution scale of the divide-and-conquer (p) method | p | = n problem P, then:
(1)
The Iterative Method for Solving recursive equations described in the progressive advanced solution of recursive equations in the complexity of algorithms can be used to obtain the solution (1:
(2)
Note that the recursive equation (1) and its solution (2) only gives the T (n) value when n is the power of M, but if T (n) is considered smooth enough, then, the growth rate of T (n) can be estimated by the value of T (n), which is the power of M. Generally, we can assume that T (n) is monotonic increasing, so that when MI ≤ n <MI + 1, t (MI) ≤ T (N) <t (MI + 1 ).
Another issue that needs to be noted is that when analyzing the efficiency of the divide and conquer method, we usually get a recursive inequality:
(3)
Because we are concerned about the upper limit of computing time complexity in the worst case, there is no essential difference between using equal sign (=) or less than or equal to sign (≤.