Commonly used algorithmic ideas.
It is one of the simplest algorithms, relying on the algorithmic power of a computer to exhaust every possible possibility to solve the answer.
Perform steps: 1) For one possible case, calculate the result.
2) Judge whether the result meets the requirements, and if not, execute 1 to continue the search. Satisfying means finding a correct answer.
It is a representative of rational thinking, based on existing data and relationships, and gradually deduces and obtains results.
Perform steps: 1) Solve the intermediate results according to the known results and relationships.
2) Judge whether the requirements are met, if not, continue to solve the intermediate results according to the known results and relationships;If the requirements are met, it means that a correct result has been found.
The program repeatedly calls itself to reach a solution to the problem.
The recursion of methods is divided into: direct recursion and indirect recursion.
Pros: Simple, readable model.
Disadvantages: It does not reduce the size of the ** to save memory space.
A computationally complex problem is divided into smaller, simpler problems to solve, and then the final answer is obtained by combining the small problems.
Execution steps: 1) Determine a difficult problem with a scale of n that is difficult to solve directly.
2) The problem is decomposed into m smaller sub-problems A, which are independent of each other and have the same form as the original problem.
3) Solve these small problems recursively, that is, solve them one by one.
4) Then, the solutions of each sub-problem are merged into the solution of the original problem.
It is not possible to calculate the analysis, and the solution value of the actual problem is solved by approximating the value.
Execution steps: 1) Transform the problem into the corresponding geometry S, the S area is easy to find, and the result of the problem corresponds to the problem of a certain part of the geometry S1.
2) Then, sprinkle dots into the geometry.
3) Count the number of points in the geometric figures S and S1, and calculate the results according to the area relationship and the number of points.
4) Judge whether the above results are within the required accuracy.
Author: Hello Ergou.