• Day • algorithm [more] Twenty of the partition structure

▎ What is divide and conquer?

"define"

  Divide and conquer, literal interpretation of the "divide and rule" is to a complex problem into two or more of the same or similar sub-problems, then sub-problems into smaller sub-problems ...... until the last sub-problem can be simple the direct solution, the combined solution is the solution that is the problem child of the original problem. In computer science, divide and conquer is to use A DC thought it important algorithms. Partition method is the basis for many of efficient algorithms, such as sorting algorithms (quick sort, merge sort), the Fourier transform (Fast Fourier Transform) and the like. (Copy from Baidu)

  Sentence summary: divide and conquer is the big problem into a number of small problems, after solving small problems, big problems will be solved naturally.

"conditions of use"

  ① large problem into smaller problems easier to solve.

  ② big problem can be broken down into sub-problems, and the optimal solution is the optimal solution to a big problem in sub-problem.

  ③ When you merge sub-problems, the solution can be a big problem.

  Public child there is no problem between ④ any child issues.

'Apply'

  Merge sort , half &-thirds , quick sorting.

▎ configuration partition

 ☞ "general steps divide and conquer."

   Problems substantially the same as the input is divided into k sub-problems, and as far as possible the size of the k sub-problems: 1. partitioning step.
   2. Governance step: When the scale of the problem is greater than a predetermined threshold value when n0, governance step of k recursive calls components.
   3. The combination of steps: a combination of various sub-step solution to the problem of combined its algorithm divide and conquer the actual performance is critical, the effectiveness of the algorithm greatly depends on the implementation of a combination of steps.
   Divide and conquer key is a combination of steps of the algorithm. How exactly should the merger, there is no uniform pattern, hence the need for specific analysis of specific issues in order to obtain a better merge algorithm. (Copy from Baidu)
  Baidu said on too esoteric, we just need to break down sub-problems, then one by one, and finally merge the answer to.

Guess you like

Origin www.cnblogs.com/TFLS-gzr/p/11225057.html