ComputersProgramming

Solving the problems of programming. Cyclic Algorithm

The uniqueness of the programming capabilities offered by modern computer systems lies in the simplicity and accessibility of solving a whole range of very diverse tasks. The most complex issues are solved quickly and do not require additional costs of both time and intellectual efforts of the programmer. But even cutting-edge utilities-assistants work with a creak without the user mastering the basics that are familiar to us from the high school informatics course.

Starting to implement any of its ideas in the code, the programmer is simply required to implement a schematic description of the progress of the solution. For a long time already invented the rules and order of compiling algorithms. In the special literature, the algorithm is given the definition of an exact and understandable prescription to perform a strictly defined sequence of operations. As a result of their implementation, we achieve the goal or arrive at a solution to the task.

The term "algorithm" was given its name on behalf of the Uzbek thinker Al-Khwarizmi. His work "Arithmetic treatise" became the basis of the rules of arithmetic operations on numbers, and the rules themselves were called algorithms. With the addition, subtraction, division and multiplication, the world history of programming began.

A cyclic algorithm is distinguished in a diverse list of different ways of solving similar problems. It is like walking in a circle until you reach a certain goal. The programming of cyclic algorithms has one complexity, it consists in the fact that if they are incorrectly compiled or misprints, the computer can "hang" ie. Go to perform the same operations an infinite number of times.

According to modern interpretation, the cyclic algorithm is the order of certain actions that are repeated over changing initial data. By itself this order is realized without certain difficulties. A cyclic algorithm is a combination of the capabilities of a linear algorithm and an algorithm with branching.

Despite the simplicity of implementation and a certain uniformity of tasks, several types of algorithms are typical for this type of algorithms. A cyclic algorithm serves to implement in practice three types of different cycles. By their names, one can judge about their characteristic features and the type of tasks to be solved.

A cycle with a precondition involves checking the condition for the execution of the algorithm before the list of operations (compiled as a linear algorithm). A cycle with a postcondition differs from the previous one in that the condition is checked after the linear component is fulfilled. A cycle with a parameter is characterized by the presence of a certain indicator, increasing or decreasing with the execution of the list of operations. A cyclic algorithm with a counter, so sometimes called this type of cycles.

Despite the simplicity of implementing this type of algorithm in two less complicated variants, each modern programming language has its own set of instructions for composing cycles. It is possible to create in the body of one program from one to several cycles, depending on the nature of the problem being solved.

The cyclic algorithms themselves have become very popular in the programming process. In addition to specific programs that perform certain tasks, there are empty cycles. Their task is to create pauses.

The cycle itself can be represented by two generally accepted phrases. For example, the following statement is already a cyclic algorithm:

- rub the handkerchief;

- if the handkerchief is dirty, then go to the beginning of the cycle.

You can come up with a lot of similar examples. Much more diverse manifest themselves cycles when performing graphic tasks, even the creation of raster on the monitor screen is a merit of cyclic programs. Arrays, logical tasks, serious and entertaining programs can not do without using the merits of cyclic algorithms.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

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