ComputersProgramming

An algorithm is a clearly defined sequence of performing mathematical operations

Computer computing is based on the 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 a clear, in an absolute sense, record of the sequence of performing the mathematical operations necessary to perform the set 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 initial data), performing specified actions with data, outputting the result.

The block of the beginning and the end of the algorithm is represented on the scheme 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 description of the order of actions 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 the data for compliance with a 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 using another kind of algorithm - with branching.

A branching algorithm is a description of a given 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 another.

The verification unit is depicted in the form of a diamond with one input and two outputs, corresponding to the positive or negative passage of the test.

As a rule, the solution of simple problems can be depicted in the form of a small block diagram. But if the task set before 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, pre-defined 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 represented 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.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.birmiss.com. Theme powered by WordPress.