In programming, algorithms are implemented in the form of sentences in some language of programming.In this way, the way of writing the algorithms depends on the programming language, and the paradigm used.These are the algorithms that can be interpreted by a computer and thus be executed.
The algorithms also can be represented graphically using flowcharts or similar forms.In this way, they are easily understandable, especially for people who are not programmers.Also, in this way, the algorithms are more "universal", because they do not depend on a specific programming language.
Algorithms can also be written in pseudocode, which also makes them easy to understand.
Attempts are made for computers to interpret and execute flowcharts and pseudocodes, but they do not achieve the flexibility, power and speed of algorithms purely written in a specific programming language.
An algorithm can also be expressed in natural language, although this can bring ambiguities and erroneous interpretations (the ambiguity is typical of human language).
Algorithms in programming
A computer program is an algorithm that tells the computer the specific steps to carry out a task.The algorithms are rigorously defined so that the computer can interpret them.The order in which each of the steps that constitute an algorithm is executed is fundamental.The most basic order is from top to bottom, executing one instruction after another of a code But an algorithm can vary in its flow or order of execution of steps depending on the start values or which enter during its execution.The flow is handled by the control structures.
Alg Some authors consider that the execution flow of an algorithm must stop correctly sometime, and that this is part of the algorithm definition, while others do not consider it that way.
Predefined algorithms
There are already mathematically defined algorithms that are very efficient, such as the search algorithms or the Dijkstra algorithm, and are usually taken by other programmers to use them within their own codes.
Related: • Judgments of programming • Source code • Function • Procedure
Comments
Post a Comment