Home >Common Problem >What is the algorithm?
Algorithm refers to an accurate and complete description of a problem-solving solution, and is a series of clear instructions for solving a problem. Instructions in an algorithm describe a computation that, when run, can start from an initial state and a (possibly empty) initial input, go through a limited and clearly defined series of states, and finally produce an output and stop at a final state.
Algorithm refers to an accurate and complete description of the problem-solving solution. It is a series of clear instructions for solving the problem.Algorithm It represents a systematic approach to describing the strategic mechanism for solving problems. In other words, it is possible to obtain the required output within a limited time for certain standardized inputs.
If an algorithm is flawed or inappropriate for a problem, executing the algorithm will not solve the problem. Different algorithms may use different time, space, or efficiency to complete the same task. The quality of an algorithm can be measured by its space complexity and time complexity.
Instructions in an algorithm describe a computation that, when run, can start from an initial state and (possibly empty) initial input, go through a limited and clearly defined series of states, and finally produce an output and Stop at a final state. The transition from one state to another is not necessarily deterministic. Some algorithms, including randomized algorithms, contain random inputs.
An algorithm should have the following five important characteristics:
Finiteness
(Finiteness)
The existence of the algorithm Definiteness means that the algorithm must be able to terminate after executing a limited number of steps;
Exactness
(Definiteness)
Each step of the algorithm must have an exact definition;
Input
(Input)
An algorithm has 0 or more inputs to describe the initial situation of the operation object. The so-called 0 inputs refer to the algorithm itself. The initial conditions are specified;
Output items
(Output)
An algorithm has one or more outputs to reflect the results of processing the input data. An algorithm without an output is meaningless;
Feasibility
(Effectiveness)
Any computational steps performed in an algorithm can be broken down into basic executables The operation steps, that is, each calculation step can be completed within a limited time (also called effectiveness).
For more related knowledge, please visit PHP Chinese website! !
The above is the detailed content of What is the algorithm?. For more information, please follow other related articles on the PHP Chinese website!