In order for the computer to complete the work scheduled by people, we must first design an algorithm for how to complete the scheduled work, and then write a program based on the algorithm. The computer program must give a correct and detailed description of each object and processing rule of the problem. The data structure and variables of the program are used to describe the object of the problem, and the program structure, functions and statements are used to describe the algorithm of the problem. Algorithmic data structures are two important aspects of programs.
An algorithm is a precise description of the problem-solving process. An algorithm consists of a finite number of instructions that can be executed completely mechanically and have a certain result. Instructions correctly describe the tasks to be accomplished and the order in which they are to be performed. The computer's instructions for executing an algorithm in the order described by the algorithm instructions can terminate within a limited number of steps, either by giving a solution to the problem, or by indicating that the problem has no solution for the input data.
Usually there may be multiple algorithms to choose from to solve a problem. The main criteria for selection are the correctness and reliability, simplicity and understandability of the algorithm. Secondly, the algorithm requires less storage space and executes faster.
Algorithm design is a very difficult task. Commonly used algorithm design techniques include iteration, exhaustive search, recursion, greedy, backtracking, divide and conquer, dynamic programming, etc. In addition, for
Expand