/ / Algorithm is a clearly defined sequence of performing mathematical operations

An algorithm is a clearly defined sequence of performing mathematical operations

Computer hardware is based onthe principle of sequential execution of mathematical operations. Because of this, it becomes necessary to compile programs that perform certain specific sequences of actions in a given order. Since programs can be huge and cumbersome, a specialist often encounters the need for a graphic (visual) drawing up of a work plan - an algorithm.

The algorithm is
The algorithm is clear in absolute termsrecord the sequence of mathematical operations necessary to perform the computer task. It can also be noted that it is a sequence of step-by-step implementation of the initial input data to the final result. The point is that the goal of any program is to perform sequential actions: polling the user (entering the initial data), performing the specified actions with the data, outputting the result.

The start and end block of the algorithm isscheme in the form of an oval and has one output and one input, respectively. Blocks input and output data - in the form of a parallelogram. Blocks of mathematical operations are represented in the form of rectangles and also have one input and one output.

The simplest (basic) type of order descriptionaction is a linear algorithm. This version of the visual image of the program is performed as a step-by-step transformation of the input external data into the final result with subsequent output to visual devices. In a linear algorithm, each subsequent operation or action begins to be performed strictly after the end of the previous operation or action.

Often there is a need to verify dataon the correspondence to any condition. And depending on the result you need to perform this or that action. It is not difficult to guess that the program will be described with the help of another version of the algorithm - with branching.

The branching algorithm is
A branching algorithm is a description of a givena sequence of actions, including checking the data for compliance with a given condition. The result of such a check can be either the correspondence of the data to be checked to a given condition or a mismatch. And depending on the result, either one further sequence of actions is performed, or the other.

The auxiliary algorithm is
The verification unit is represented as a diamond with one input and two outputs, corresponding to a positive or negative check.

As a rule, the solution of simple problems can beto depict in the form of a small block diagram. But if the task assigned to the programmer is sufficiently large, then the algorithm depicted on the paper (monitor) can turn into a bulky monster. To simplify the visualization of the sequence of actions, auxiliary structures are used.

The auxiliary algorithm is a fragment of the plan,describing a certain, predetermined sequence of actions, taken apart from the basic algorithm and designed to simplify, reduce the original size of the latter. This fragment can be used any number of times provided that the input data are strictly matched.

The block of the auxiliary algorithm is depicted on the diagram in the form of a rectangle with a conditional description pointing to the place in which one can find a schematic, that is, an open, image of the block.

Read more: