Importance of Algorithms
Miscellanea / / August 08, 2023
When we carry out a computer program, we cannot start writing sentences (commands, instructions) without further ado. Before, we have to plan (and more thoroughly the bigger and more difficult the program we want build) what exactly the program is going to do and how it is going to do it, and then translate this algorithm into instructions.
We define an algorithm as a finite and structured sequence of orders that constitute the instructions for a computer or other analog machine with processing capabilities (such as a smartphone).
The algorithm is not the program itself, but rather the latter is the realization of the algorithm in a language that the machine that should execute it can understand it.
And here, a little clarification: algorithms are generally implemented in computers by means of programming languages high-level files, which are not directly executable, but are "compilable" (a process that generates a software that the computer can understand and execute).
This high-level programming language is somewhere between something understandable to a human of a foot (although it requires some technical knowledge) and what can be understood and executed directly by a computer.
If we look for an encyclopedic definition, algorithms are as old as the first written instructions to carry out a task.
Let's take an example: milking a cow. first calm the animal down. Then put a container under the udders. Next, sit looking at the cow's udders. Place your hands around two of the animal's four udders and lightly squeeze the base of each udder. repeat the motion until there is no milk left in the udders. Now do the same for the remaining two udders until they are also empty. Remove the container filled with milk. He has finished.
Let's review: we have a set of specific instructions that end at a certain point. We have an algorithm for milking cows.
In all the algorithms we find elements that are repeated, such as loops (repeat the movement), decision making (is the udder empty? No -> continue milking; if -> go to the other two or finish), and actions.
These elements, loops, conditions, jumps and actions, have their correspondences in the structures of programming languages. programming, although they have a greater number of structures to be able to deal with the resolution of the specific problems that they show up.
The algorithm is an abstraction of the resolution of a problem, which, when implemented in a programming language, requires more complicated structures.
This is the case of functions, which perform a specific task and can be called from different parts of the program.
There are different ways of expressing algorithms.
The most intuitive is that of natural language, as in the case of milking a cow that I have explained before. It is simply enough for us to describe in a concise way the instructions to carry out a task. However, it is not a standardized way, it only works for oneself or among a very small group of people, and for really simple tasks.
If we are looking for something regulated and standardized, we have the flowcharts, a very visual graphic form that represents the main actions and decisions that are taken in the execution of the algorithm.
The pseudocode in a formal representation in text much more similar to a programming language, which has its elements and which is easily transferable to a compilable code.
Fotolia: doyata – hanss
write a comment
Contribute with your comment to add value, correct or debate the topic.Privacy: a) your data will not be shared with anyone; b) your email will not be published; c) to avoid misuse, all messages are moderated.