Home  >  Article  >  Does a program have to be an algorithm?

Does a program have to be an algorithm?

藏色散人
藏色散人Original
2021-10-15 13:47:4519246browse

A program is not necessarily an algorithm, because an algorithm is a step to solve a problem, and a program is the code of an algorithm. Implementing an algorithm depends on the program to complete the function; for example, writing a functional program, using different algorithms can make the program The volume and efficiency are much different, so algorithms are the essence of programming.

Does a program have to be an algorithm?

The operating environment of this article: windows7 system, DELL G3 computer

Does the program have to be an algorithm?

A program is not necessarily an algorithm. [Program = data structure algorithm]

Algorithms are the steps to solve problems. Programs are the code of algorithms. Implementing algorithms depends on programs to complete functions. Programs need algorithms as their souls.

Programs are results, algorithms It is a means (the calculation method used to write a good program). When writing a program with the same function, using different algorithms can make the size and efficiency of the program much different, so algorithms are the essence of programming.

Related introduction:

Generally speaking, some algorithms are ideas for solving a problem, and programs are specific codes that can be written to solve these problems. Algorithms have no language boundaries, they are just an idea. To implement the same algorithm, programs written in different languages ​​will be different.

Programs must be written in a prescribed programming language, and algorithms are very arbitrary. Algorithms are a series of clear instructions for solving problems. That is to say, they can obtain the required input within a limited time based on certain standardized inputs. The output of algorithms often contains repeated steps and some logical judgments.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of Does a program have to be an algorithm?. 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