Algorithm: What is it, what is it used for, and how does it work in computer science?

Last update: 10/08/2022
Algorithm: What is it, what is it used for, and how does it work in computer science?

The algorithms They are widely used, and there are many opinions depending on the area in which they are discussed.In this case, the type of algorithm we mentioned is at the level of computersTo give a brief introduction, we'll tell you that it's the most commonly used thing, even before any program.

Part of its usefulness stems from the fact that It's the easiest way to make one programmingbecause it's much easier to understand visually. If you want to learn more about this topic, We invite you to read on, because this post contains some very good material for you.

Here you will find, from What is an algorithm? and its most common characteristics so that we can differentiate it from any other computer programming method, including its parts and the types that exist today.

What is an algorithm and what is it used for in computer science?

The Algorithms are lines of instructionsThey're like a step-by-step guide to the things that need to be done, but under no circumstances We can compare them to programming languagesThanks to them, many processes can be carried out successfully, even adhering to the order of answer in some situations.

Its structure It involves a set of ordered and finite stepswhich allow for problem-solving, and in some cases, decision-making.

Algorithms are represented in flowcharts, where each shape has a specific symbol. Their function, in short, is to... some prior programming arrangements. It is also seen as a kind of programmatic draft, since does not include languagesbut what we want done in the correct order.

What are the main characteristics of a computer algorithm?

algorithms
The algorithms They are very useful and meet the following characteristics:

  • It is necessary to indicate in them the order in which the actions must be performedThat is, step by step.
  • It's definedIn other words, it doesn't matter how many times an algorithm is followed, because the result will be the same.
  • They shouldn't be infinite algorithms, they must be finite, since it has a start and end of operations.
  • It must be as legible as possiblebecause it is the one that will allow us to understand it and read it as easily as possible.
  • Algorithms are defined in three parts: entrance, pprocess, salida

We can use as an example, a recipe book that explains:

  • Entrada: Ingredients and utensils
  • Processes: Preparing the recipe in the kitchen
  • Starting time: Finishing the dish
What is a URL, what is it used for, and what do its initials mean in computing and websites?

What are the parts of a computer algorithm?

To be more explicit about the parts of an algorithm, We leave the following:

  • Entrada: The input is known as all the information that an algorithm provides, that is, all those values ​​that will be worked with.
  • Processing: These are all the calculations we need, so that we can start from a piece of data that we call input, until we achieve to obtain an expected result.
  • Starting time: It is known as the exit, to the entire final result obtained through the process.

Types of algorithms: How are they classified?

Algorithms are classified according to type, such as We show them below:

Computational algorithms

These are the types of algorithms whose solution depends entirely on calculation, and which are developed using a calculator or computer. without any trouble.

Non-computational algorithms

It is an algorithm that does not require a computer process to solve steps or problems, whose steps for resolution They are instructed by a human being.

Qualitative algorithm

It is the algorithm that allows the resolution without the involvement of numerical calculationsbut with logical and/or formal sequences.

Quantitative algorithms

It's the complete opposite of the algorithm we showed earlier, because it depends of mathematical calculations to provide a resolution.

What are the main methods of expressing an algorithm?

Of the many ways algorithms can be expressed, we can find natural language, pseudocode, flowcharts, and programming languages, but these are not the only ones, because there are still more. Although natural languages They are enigmatic and extensive.

To avoid some incomprehensible conditions, pseudocodes and flowcharts are used, so that it can be clearer when interpreting them. With these expressions we present what the algorithms are like and what their structure is, also including the specific programming language.

Algorithms use a programming language that is divided as follows:

  • High-level description: This is where the problems are defined, then the mathematical model is selected and the algorithm is explained verbally, although some include illustrations…
  • Formal descriptions: That's where pseudocodes come in, useful for describing the sequence of each of the steps to follow to find the solution.
  • Implementation: Algorithms are shown expressed in specific programming languages ​​or of some specific object, fully capable of carrying out a series of instructions or steps.

In order to demonstrate that the algorithms are correct, we must include a theorem, which allows us to give an opinion depending on the result of the study we conduct.

Linux Snaps: What are they, what are they used for, and what are the advantages of installing software with them?

Natural language

These are languages ​​that arise spontaneously within a group of speakers for the purpose of communication, which is entirely different from other languages. Such languages ​​can be constructed, or simply formal or simple programming languages ​​used for 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 given problem is solved.

The drawbacks that We can present the following when creating an algorithm with a language:

  • Ambiguity
  • Non-universality
  • Its breadth, which generates many errors.

Pseudocode

It's the one that does the high-level description of the algorithmswhich we can use to make a mixture of natural languages, with some syntactic conventions that are specific to the language itself, such as assignments, loops and some conditions, although it is not standardized.

It is generally used for describe algorithms in books or scientific publicationsIt is also an intermediate product in the development of an algorithm. This offers a significant advantage over algorithms, as they are described in pseudocode, which requires less storage space.

It is designed to make it easier for people to understand the algorithms; on the other hand, we can omit some irrelevant details that are highly useful for some implementations.

Pseudocode is based on various conventions, which in turn are based on the syntax of specific programming languages. However, in some cases, it can be understood without knowing or using a specific programming environment.

Examples of algorithms: How to easily identify one?

To help you understand this a little better, We'll leave you with these simple examples:

Algorithm for choosing party shoes:

  • Needing the shoe and knowing which one to look for
  • Search the Store
  • Verify that they are the ones we are looking for

Yes (go to the next step), No (go back to the previous step)

  • Is this the size we're looking for?

Yes (Next step), No (Back to step three)

  • Can we afford it?

If (next step), No (return to step 3)

  • Buy the pair of shoes
  • Lesson finish date

Algorithm for preparing dinner:

  • Knowing what we are going to cook
  • Find the ingredients to cook
  • Prepare each one
  • Finish the preparation
  • Eat
  • Lesson finish date

Before concluding this article, we leave you with some symbols used in an algorithm flowchart, so that you can quickly identify one.

flowchart symbols

Ebooks of IPAP
Ebooks IPAP

🔥JOIN🔥 THE NEW IP@P COMMUNITY! SIGN UP HERE!

Themes

Author: Félix Albornoz

I have over 20 years of experience working in the technology sector, helping companies and users develop and train in this field. I'm always learning new things.

Related

Comments are closed.