Complexity Analysis of divide and conquer Law

Source: Internet
Author: User
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 (≤.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.