We explain what a computer algorithm is, what it is for and what its parts and characteristics are.

What is an algorithm?
In computing, an algorithm is called a sequence of specific instructions or operations that allow controlling certain processes. These are finite and ordered sets of steps that lead us to solve a problem or make a decision.
For example, a simple, everyday action such as turning on the light in the room can be described as an ordered set of steps, such as:
2) Is the light off?
NO: END
YES: go to step 2
2) Press the switch and return to step 1.
Today, the presence of algorithms is well known thanks to digital automation. Extremely complex and specialized algorithms control the operation of social networks and internet search engines among other pieces of software, to allow the user a personalized experience.
However, they are also used in mathematics and logic, among other disciplines, and are often equated with flowcharts.
Etymology: Despite this association with computing, the term “algorithm” is not exactly new: it comes from Latin algorithmus and, in turn, from the surname of the Persian mathematician Al-Juarismi. One of the oldest algorithms in mathematics is attributed to the Greek philosopher Euclid (ca. 325-ca. 265 BC), and serves to obtain the greatest common divisor of two positive integers through a series of sequential steps and well delimited.
See also: Variable
What is an algorithm for?
An algorithm is used to make a decision in a controlled manner or to solve a problem step by step. In this sense, algorithms are used in mathematics and logic: many of the traditional calculation procedures consist of applying an algorithm.
Additionally, algorithms are used in instruction manuals and other publications intended to guide the reader in a specific direction.
In computer science, however, Algorithms constitute the skeleton of the processes that will later be codified and they will be programmed so that they are carried out by the computer. For this reason, the same algorithm can be translated into different programming languages, given that it is a set of logical instructions, prior to the programming itself.
In fact, A computer program can be thought of as a complex series of algorithms. ordered and coded using a programming language, for subsequent execution in a computer system.
Algorithm characteristics
The algorithms have the following general characteristics:
- are sequential. They operate in sequence: they must be processed one at a time, starting with the first instructions and moving linearly towards the last ones.
- are precise and specific. The instructions that make them up cannot be ambiguous or subjective, but rather direct, easy to follow and as little general as possible.
- are ordered. They must be read in a specific order to make sense. Misplacing an algorithm or an element of the algorithm can invalidate the others.
- are finite. They have a certain beginning and end.
- are defined. The same algorithm must always give the same results if it is fed by the same elements.
Parts of an algorithm

Algorithms have a fixed structure, which is composed of the following three parts:
- Input or entrance.Contains the initial instructions, in which the data that the algorithm needs to operate is entered.
- Process or instructions. It is made up of the logical operations that the algorithm will undertake with what is received from the input.
- Output or exit. They are the results obtained after the process, once the execution of the algorithm has finished.
Types of algorithms
In computing, types of algorithms are distinguished based on different criteria.
According to the processes that require:
- Computational algorithms. They are those whose resolution can be carried out using a calculator or computer.
- Non-computational algorithms. They are those that do not depend on calculation and do not require computer processes to be solved.
According to the sequences involved:
- Qualitative algorithms. They are those whose resolution does not involve numerical calculations, but rather logical and/or formal sequences.
- Quantitative algorithms. They are those that depend on mathematical calculations to find their resolution.
According to your purpose:
- Search algorithms. They are those that allow elements of specific traits to be located within a data set.
- Sorting algorithms. They are those that allow a set of data to be organized according to a specific criterion.
- Predictive algorithms. They are those that allow us to make logical future projections of a problem, that is, to look for probable options for input.
- Probabilistic algorithms. They are those that allow obtaining a random result within an established set of data.
- Optimization algorithms. They are those that seek to make a given process more efficient, and to achieve this, they look for alternatives to the elements of a data set.
Examples of algorithms
The following are possible algorithm examples:
- Algorithm to choose party shoes:
START
1) Look for the men's shoes section in the store.
2) Take a pair of shoes. Are they party shoes?YES: go to step 3 – NO: go back to step 2
3) Is there the right size?
Yes: go to step 4 – NO: go back to step 2
4) Is the price appropriate?
Yes: go to step 5 – NO: go back to step 2
5) Buy the pair of shoes.
END - Algorithm to calculate the area of a right triangle:
START
- Find the measurements of the base (b) and height (h)
- Multiply base by height (bxh)
- Divide the result by 2 (bxh) / 2
END
Continue with: Examples of algorithms
References
- Chacón Sartori, C. (2023). Programming principles. Marcombo.
- Garate, G. (sf). “What do we understand by algorithm?” Business University (UDE). https://ude.edu.uy/
- The Encyclopaedia Britannica. (2024). Algorithm (mathematics). https://www.britannica.com/