What is divide and conquer?

The "divide and conquer" method (also known as "divide and conquer") is a technique commonly used in effective algorithm design.
The so-called "divide and conquer" is to divide a complex algorithmic problem into several equivalent smaller parts according to a certain "decomposition" method, and then solve them one by one, find the solutions of each part separately, and combine the solutions of each part into the whole problem Solution.
This kind of simple thinking comes from people's experience in life and work, and is completely suitable for the technical field. Such as software architecture design and modular design are concrete manifestations of divide and conquer.
Basic idea:
The method of divide and conquer is very similar to the modular method of software design. To solve a big problem, you can:
1. Divide it into two or more smaller problems;
2. Solve each small problem separately;
3. Combine the answers to the small problems to get the original problem answer. Small problems are usually similar to the original problems and can be solved recursively using the divide and conquer strategy.

Reprinted from Baidu Encyclopedia

Guess you like

Origin blog.csdn.net/weixin_45402023/article/details/109295796