Features:
1, Input: An algorithm must have zero or more inputs.
2. Output: An algorithm should have one or more outputs, and the output is the result of algorithm calculation.
3. Clarity: The description of the algorithm must be clear to ensure that the actual execution results of the algorithm accurately meet the requirements or expectations. It is usually required that the actual operation result is certain.
4. Finite: According to Turing's definition, an algorithm is a series of operations that can be simulated by any Turing complete system, while a Turing machine has only a limited number of states, a limited number of input symbols and a limited number of transfer functions (instructions). Some definitions even stipulate that the algorithm must complete the task in a limited number of steps.
5. Effectiveness: also known as feasibility. The operations described in the algorithm can be realized by performing basic operations that have been implemented a limited number of times.
Extended data:
Universal design pattern
Complete ergodic method and incomplete ergodic method: When the solution of the problem is a finite discrete solution space and its correctness and optimality can be verified, the simplest algorithm is to completely traverse all the elements in the solution space and check whether these elements are the solutions we want one by one.
This is the most direct algorithm, and the implementation is often the simplest. However, when the solution space is particularly large, this algorithm is likely to lead to unbearable calculation in engineering. At this time, we can use incomplete traversal methods, such as various search methods and planning methods, to reduce the amount of calculation.
1, divide-and-conquer method: the idea of dividing a problem into independent parts and solving them separately. One advantage of this solution is that it is convenient for parallel computing.
2. Dynamic programming method: a method often used when the global optimal solution of the problem consists of local optimal solutions.
3. Greedy algorithm: a common approximate solution. When the global optimal solution of the problem is not (or cannot be proved to be) composed of local optimal solutions, and there is no requirement for the optimality of the solution, a method can be adopted.
4. Degeneracy method: A method of simplifying a problem into an equivalent or approximate relatively simple model through logical or mathematical reasoning, and then solving it.