Algorithm refers to an accurate and complete description of the solution to the problem. It is a series of clear instructions for solving the problem. The algorithm represents the systematic method to describe the solution to the problem. Strategy mechanism. (Recommended Learning: PHPSTORM )
##. 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. The concept of formal algorithms originated in part from attempts to solve Hilbert's decision problems and took shape in subsequent attempts to define efficient computability or efficient methods. These attempts included recursive functions proposed by Kurt Gödel in 1930, Jacques Herbrand and Stephen Cole Crane in 1934 and 1935 respectively, and Alonzo Church in 1936. The lambda calculus proposed in 1936, Formulation 1 by Emil Leon Post in 1936, and the Turing machine proposed by Alan Turing in 1937. Even now, there are still situations where intuitive ideas are difficult to define as formal algorithms.The five major characteristics of the algorithm are as follows:
Finiteness. The finiteness of an algorithm means that the algorithm must be able to terminate after executing a limited number of steps; Definiteness. Each step of the algorithm must be clearly defined; Input. An algorithm has 0 or more inputs to describe the initial situation of the operation object. The so-called 0 inputs mean that the algorithm itself sets the initial conditions; Output (Output). An algorithm has one or more outputs that reflect the results of processing input data. An algorithm without output is meaningless; Effectiveness. Any calculation steps performed in the algorithm can be decomposed into basic executable operation steps, that is, each calculation step can be completed within a limited time (also called effectiveness).The above is the detailed content of What are the 5 characteristics of an algorithm?. For more information, please follow other related articles on the PHP Chinese website!