Home  >  Article  >  How to understand that algorithms are the soul of programming

How to understand that algorithms are the soul of programming

coldplay.xixi
coldplay.xixiOriginal
2020-08-14 14:00:059890browse

Understanding algorithms is the soul of programming: Algorithms are the basis for computers to process information, because computer programs are essentially algorithms, telling the computer the exact steps to perform a specified task.

How to understand that algorithms are the soul of programming

Understanding algorithms is the soul of programming:

Algorithms are the basis for computers to process information, because of the nature of computer programs It's the algorithm that tells the computer the exact steps to perform a given task, such as calculating an employee's salary or printing a student's transcript. Typically, as an algorithm processes information, data is read from input devices, written to output devices, and possibly saved for later use.

The famous computer scientist Worth proposed the following formula.

Data structure algorithm = program

In fact, a program should be programmed using structured programming methods and expressed in a certain computer language. Therefore, it can be expressed by the following formula.

Program = algorithm, data structure, programming method, language and environment

The four aspects in the above formula are the knowledge that a programming language should have. Among these four aspects, the algorithm is the soul, the data structure is the processing object, the language is the tool, and programming needs to use appropriate methods. Among them, algorithms are used to solve the problems of "what to do" and "how to do it". In fact, the operation statements in the program are the embodiment of the algorithm. Therefore, if you don't understand the algorithm, you can't talk about programming. Data is the object of operation, and the description of the operation is the operation step. The purpose of the operation is to process the data to obtain the desired results. To give a simple example, a chef needs a recipe to make dishes. The recipe should generally include: ① ingredients (data), ② operating steps (algorithm). In this way, dishes with different flavors can be processed from the same raw materials.

Related learning recommendations: Programming video

The above is the detailed content of How to understand that algorithms are the soul of programming. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn