Algorithms are widely used, and there are many inclinations depending on the area where they are discussed . In this case, the type of algorithm that we mention is at the computer level, which by making a small introduction, we tell you that it is the most used, before even any program.
Part of its usefulness is given because it is the easiest way to make programming, since it is much easier to understand it visually. If you want to know a little more about this topic, we invite you to read below, because in this post there is very good material for you.
Here you will find, from what an algorithm is and its most common characteristics so that we can differentiate it from any other computer programming method, to what its parts are and the types that exist today .
What is an algorithm and what is it used for in computing?
The algorithms are lines of instructions are a step by step of what must be done, but none of the world can compare with the programming language. Thanks to them, many processes can be fully carried out, complying with the order of response in some situations.
Its structure includes a set of ordered and finite steps, which allow the solution of problems, and in some cases in decision-making.
The algorithms are represented in flowcharts or flowcharts, where each figure includes a symbology. Its function, in a few words, is to make a preliminary ordering of the programming. It is also seen as kind of a programmatic draft, since it does not include languages, but what we want to be done in the correct order.
What are the main characteristics of a computer algorithm?
The algorithms are very useful and meets the following characteristics:
- It is necessary to indicate in them the order in which the actions must be carried out, that is, step by step.
- It is defined, that is, it does not matter how many times an algorithm is followed, because the result will be the same.
- They must not be infinite algorithms, they must be finite, since it has a start and end of operations.
- It must be as legible as possible, because it is what will allow us to understand and read it as easily as possible.
- Algorithms are defined in three parts: input, process, output
We can use as an example, a recipe book that explains:
- Input: Ingredients and utensils
- Processes: Preparation of the recipe in the kitchen
- Output: Plate completion
What are the parts of a computer algorithm?
To be more explicit with the parts of an algorithm, we leave the following:
- Input: it is known as input to all the information that an algorithm gives, that is, all those values with which it will work.
- Process: they are all the calculations that we need, so that we can start from a data that we call input, until we achieve an expected result.
- Output: it is known as output, to all the final result obtained through the process.
Types of algorithms How are they classified?
Algorithms are classified according to type, we will show you below :
They are the types of algorithms whose resolution depends clearly on the calculation, and that are developed by means of a calculator or computer without any difficulty.
It is the algorithm that does not require a computer process to solve steps or problems, whose resolution steps are instructed by a human being.
It is that algorithm that allows the resolution without involving numerical calculations, but with logical and / or formal sequences.
It is the opposite of the algorithm that we showed previously, because it depends on mathematical calculations to give a resolution.
What are the main expression methods of an algorithm?
Of the many ways that algorithms can be expressed, we can find natural language, pseudo-code, flowchart and programming languages, but these are not the only ones, because there are still more. Although natural languages are enigmatic and extensive.
So that some incompressible conditions can be avoided, pseudocodes and flow diagrams are used, so that it can be clearer when interpreting them, with these expressions we present how they are and what the structure of the algorithms is, also including the languages of specific programming.
The algorithms use a programming language that is divided as follows:
- High-level description: it is where the problems are established, then the mathematical model is selected and the algorithm is explained in a verbal way, although some include illustrations …
- Formal descriptions: This is where pseudocodes are used, useful for describing the sequence of each of the steps to follow to find the solution.
- Implementation: Algorithms expressed in specific programming languages or a specific object are shown, fully capable of carrying out a series of instructions or steps.
In order to prove that the algorithms are correct, we must include a theorem, which allows us to give an opinion depending on the result of the study that we carry out.
They are those that are generated spontaneously in a group of speakers with the purpose of communicating, something that is totally different from other languages. Such, can be a constructed, or simply formal or simple programming languages, used for the study of a formal logic.
Written algorithms have the main characteristic of following a process for the execution of common and logical actions, until a specific problem is solved.
The disadvantages that we can present when making an algorithm with a language are:
- Not universality
- Amplitude of the same, which generates many errors.
It is the one that makes the high-level description of the algorithms, which we can use to make a mixture of natural languages, with some syntactic conventions that are typical of the same language, such as assignments, cycles and some conditions, although it is not standardized .
In general it is used to describe algorithms in books or scientific publications, it is also the intermediate product of the development of an algorithm. This has a great advantage over these and is that the algorithms are described in pseudocodes that require less storage capacity.
It is designed thinking about making it easier for people to understand the algorithms, on the other hand we can omit some irrelevant details that are highly useful for some implementation.
Pseudocodes are based on different conventions, which are based on concrete programming language syntax. Although in some cases, it is understandable without disclosing or using a specific programming environment.
Algorithm Examples How to easily identify one?
So that you understand a little more about this, we leave these simple examples:
Algorithm for choosing party shoes:
- Need the shoe and know which one to look for
- Search in store
- Verify that they are the ones we are looking for
Yes (go to next step), No (return to previous step)
- Is it the size we are looking for?
YES (Next step), NO (Return to third step)
- Can we pay your cost?
YES (next step), NO (return to step 3)
- Buy the pair of shoes
Algorithm for preparing dinner:
- Know what we are going to cook
- Find the ingredients for cooking
- Make the preparation of each
- Finish with the prep
Before finishing this article, we leave you some symbologies that are used in a flow-gram of algorithms, so that you can quickly identify one.
If you have any questions, leave them in the comments, we will answer you as soon as possible, and it will surely be of great help to more members of the community. Thanks!