The instructions in the algorithm describe a calculation. When it is running, it can start from an initial state and an initial input (which may be empty), go through a series of limited and clearly defined states, and finally produce an output and stop at a final state. The transition from one state to another is not necessarily certain. Some algorithms, including randomization algorithms, contain some random inputs.
The concept of formal algorithm stems in part from trying to solve the decision-making problem put forward by Hilbert, and then trying to define effective computability or effective method. These attempts include recursive functions proposed by Kurt G?del, Jacques Herbrand and Stephen Cole Kleene at 1930, 1934 and 1935 respectively, λ calculus proposed by Allonzot Church at 1936, and formulas proposed by Emil Leon Post at 1936. Even at present, it is usually difficult to define intuitive ideas as formal algorithms.
An algorithm should have the following five important characteristics:
With finiteness
(limited)
The finiteness of the algorithm means that the algorithm must be able to terminate after a limited number of steps;
tangibility
(clarity)
Every step of the algorithm must have a precise definition;
Input item
(input)
An algorithm has zero or more inputs to describe the initial situation of the operation object. The so-called zero input means that the algorithm itself has set the initial conditions;
Output item
(output)
The algorithm has one or more outputs to reflect the results of processing the input data. An algorithm without output is meaningless;
feasibility
(effectiveness)
Any calculation step performed in the algorithm can be decomposed into basic executable operation steps, that is, each calculation step can be completed in a limited time (also called effectiveness).
1. Operation and operation of data objects: The basic operations that a computer can perform are described in the form of instructions. The set of all instructions that a computer system can execute becomes the instruction system of the computer system. The basic operations and operations of computers can be divided into the following four categories: [1]
1. Arithmetic operations: addition, subtraction, multiplication and division.
2. Logical operations: OR, AND, NOT, etc.
3. Relational operations: operations such as greater than, less than, equal to and unequal to.
4. Data transmission: input, output, assignment and other operations [1]
Second, the control structure of the algorithm: the functional structure of the algorithm depends not only on the selected operations, but also on the execution order between the operations.
Algorithms can be roughly divided into basic algorithms, data structure algorithms, number theory and algebra algorithms, computational geometry algorithms, graph theory algorithms, dynamic programming and numerical analysis algorithms, encryption algorithms, sorting algorithms, retrieval algorithms, randomization algorithms, parallel algorithms, Hermite deformation models and random forest algorithms.
Algorithms can be roughly divided into three categories:
First, limited and deterministic algorithms. These algorithms are terminated in a limited time. They may take a long time to perform the assigned tasks, but they will still be terminated within a certain period of time. The result of this algorithm often depends on the input value.
Second, limited and uncertain algorithms. These algorithms are terminated in a limited time. However, for a given value (or values), the result of the algorithm is not unique or certain.
3. Infinite algorithms are those that will not stop running because there is no defined termination condition or the input data cannot meet the defined conditions. Usually, the infinite algorithm is caused by the failure to define the termination condition.
I hope it can help you solve the problem.