What are algorithms and why are they needed?

For beginners and inexperienced programmers, the question often arises: “What are algorithms and why are they needed?” Although this concept is slowly disappearing into oblivion, but it is still relevant. When creating large commercial projects, it is simply impossible to do without algorithms. And before you start programming, it is better to understand them and only then proceed to practical exercises. Although this concept is associated with the creation of software on a PC, but it is quite common in everyday life. This article will give an example of what algorithms are in real life.

What are algorithms?

In computer science

Now we find out what algorithms are in computer science and programming. Under this concept is a procedure, using which you can easily and simply solve the problem. As an example, you can give a calculation using any one formula. To do this, it will be enough to perform the following actions:

  • Enter the source data necessary for the calculations.
  • Perform calculations.
  • Display the results either on a computer screen or on some other medium
    (for example, on paper).

Kinds

The algorithm in computer science in appearance can be in the following modifications:

  • Graphically (as a set of standardized blocks).
  • Phased text description.

Algorithm in Computer Science
In the first case, it consists of standard blocks, the appearance of which is regulated by GOST with serial number 19.701-90. For example, a simple operation here will look like a rectangle, and the selection condition is a rhombus.

The text description is not so obvious and therefore is used much less frequently. In appearance, it resembles a regular bulleted list with numbers or letters. According to the structure, a linear description is distinguished with branching. The first option is much less common. The difference between them is that in the second case there are branching units and the number of calculations to obtain the final result is unknown.

Real life

Now we will understand what algorithms are in real life. When cooking various dishes, the hostess follows the recipe. For example, when cooking pasta, you need to perform the following algorithm of actions:

Informatics algorithm

  • Bring water to a boil.
  • Salt her.
  • Fall asleep pasta.
  • On low heat, stirring them, bring to a boil.
  • After they are boiled, drain the water.
  • Add butter.
  • Stir until smooth.

The dish is ready. If you look at it through the eyes of a programmer, then this is an ordinary linear algorithm written in text form. So it’s not so rare in our lives that this intricate concept occurs. We just use it and don’t even know about it.

Instead of conclusions

In many areas of human activity, such a thing as an algorithm is used. Computer science is one of them. Moreover, the most famous. A correctly composed sequence of actions can significantly simplify the process of creating a software product and improve its quality. It is like a business plan for the construction of a factory or factory. When creating simple programs, you can do without it, but when serious software is developed, you can’t go anywhere without it. It can be either generalized or detailed, but in any case it is.

Source: https://habr.com/ru/post/K10739/


All Articles