Information about types of algorithms. See algorithms

Antipyretic remedies for children are prescribed by a pediatrician. But there are situations of indispensable help for fevers, if the child needs to give faces negligently. Then the fathers take on themselves the resuscitation and stop the antipyretic preparations. What can be given to infants? How can you lower the temperature in older children? What are the most safe faces?

Abstract: The algorithm is a basic understanding for those who want to start programming, be it my own programming. Be it as a task, it can be formalized algorithmically. To understand why, let's look at the main algorithms. Meta tsієї lektsії - learn students from the understanding of the algorithm; show that such an abstract richness of the algorithm otochuє us from everyday life.

An example of pseudocode:

alg Value of a private two numbers start of dates ("specify a date and a date") input (delay, time) even a time ≠ 0 then private = a distance / time of a time of dates (private) else of a date ("no decision") con alg Value of a private two numbers

In this butt, there are three changes: delene, dilnik and private. Dilimo and dilnik are given by Vikonavtsy with sufficient numbers. Privately vvazhaetsya less than that, as a dilnik is not equal to zero.

Graphic implementation of the algorithm is a block diagram. The block diagram is made up of blocks of song form, connected by arrows. Vіdpovіd at tsimu otrimuє lyudin, yak vykonuє command zgіdno z flowchart. A report on block diagrams will be given in Lecture 2.

Software implementation of the algorithm - ce computer program, written by my algorithmic programming, for example: C ++, Pascal, Basic, etc. The program is composed of the commands of the song-movie programming. It is significant that the block diagram itself can be implemented on different language programming. Vіdpovіd otrimuє EOM, but chi is not a person. Report on the development of C ++ programming, marvel at Lecture 3.

There are three main types of algorithms:

  1. linear algorithm,
  2. the algorithm that is deciphered,
  3. cyclical algorithm.

Linear algorithm– the whole algorithm, for which dії are beaten one-time and suvoro sequentially.

The simplest example of the implementation of a linear algorithm is the way from the university to home.

Verbal way to write this algorithm:

  1. get out of the university on a zupinka;
  2. check on the required bus;
  3. take the required bus;
  4. pay the fare;
  5. to go on a toothbrush;
  6. go to the booth.

Obviously what Danish butt belong to the linear algorithm, because all children follow one by one, without minds and repetition.

Terms:2 5 .09.201 4 m.Class:9 D Vikladach:Mammadov A.

Lesson topic: « TIPI Algorithms.»

Looking at the lesson: confusion.

Objectives of the lesson:to give understanding to commands, structures of algorithms and to teach the stages of solving problems in Pascal.

STRUCTURE OF THE ALGORITHM

Linear algorithms. The stinks add up from the last simple commands block diagrams - from blocks, spreading on one line. Linear algorithm an algorithm is called, in which all operations (operations) are beaten once and sequentially one by one. Now let's put it on: alg write down homework on the cob

we’ll take a worker, we’ll need a side, and we’ll put a worker on the spot

The commands of the linear algorithm are composed of commands (blocks), which are concatenated at the sequence assignment. Such a victorious operation, one by one, is called the natural order.

Razgaluzhuvani algorithms. For everyday life Algo rhythmy basically subdivided into groups, in which fallow vikonnannya or non-violent singing, the sequence of commands is subdivided into sprats.

At The analysis of the algorithm is more important than the logic of the mind, given as an arithmetic unevenness.

Mind-checking is called by the decommissioning team. At the hour of the entry in the algorithm, the keywords are scored yakscho, then everything else. According to the method of decommissioning, the decompression command is divided into two types: the selection command (re) and the transition command (incomplete). Povna team razgaluzhennya may look like this:

yakscho umova

then 1 th series and now 2nd series

To improve the algorithms, the minds of the team are sorted out. If you know how to win, then command to win 1 -ї series, style between keywords yakschoі otherwise. If you know not to win, then the teams of the 2nd series, placed between keywords, win otherwiseі all. In the scheme of this kind of algorithm, which is rozgaluzhuetsya, obov'yazkovo enter the block of reverification of the mind. Vіn izobrazhuєtsya at the look of the rhombus and zv'yazuєtsya z іnshimi blocks behind the help of one line to the entrance and two lines to the exit.

Looks completely galvanized the algorithm needs to select only one series of two . As if it were true, then win 1 -I series, then we will move on to the upcoming operations. As soon as it’s hibno, then the 2nd series will be victorious, then we’ll just vibrate like this to the algorithm. Otzhe, zalezhno in the form of truth and chibnosti vyslovlyuvannya vikonuetsya 1 chi 2nd series.

If the algorithm is composed of an inconsistent form of the command decommissioning, then once the algorithm is completed, the "series" is completed and further the algorithm is continued. If the mind is not beaten, then the same team from the "series" is not beaten, it is necessary for the transition

Folding razvaluzhennya. Quite often the minds of the heads are distorted, that they give three or more exits. For example, as a vikonnannya of minds X 0, x = 0, X Vimagaє trioch rіznih diy, then the structure of the split can be like this, as shown in Fig.

Cyclic algorithms. Rich in algorithms, the sequence of events is repeated a few times. The calculation process, if a single part of the algorithm is repeated differently, is called cyclicalaboutsesom. The algorithm from the repeated part is called cyclical

food for fastening:

    What is the similarity of that vіdminnostі mіzh program and algorithm?

    Recalculate the power of algorithms, as they appear on a computer.

    Do you know how to describe the algorithms?

    What can be the stages of solving tasks on a computer?

    Pererakhuyte see blocks in the scheme to the algorithm, their images and links.

    What do you know about linear, decoded and cyclical algorithms?

    Name iterative cycles and their features.

meta lesson: promotion of interest to the development of the subject; vihovannya novichka shvidkogo myslennya; development of creative activity of students; development of educational interests.
Lesson task: 1. Lighting:
- learn how to understand the algorithm, how to understand, how to understand the system of commands, how to present algorithms.
- Learn about the types of algorithms: linear, decomposed, cyclical.
- Learn the appearance of algorithms in visual flowcharts.
2. Developing:
- Activate the educational activity of the students through multimedia products training.
- Develop more figurative, more critical, divergent thoughts.
3. Vikhovny:
- promotion of motivation of students at the lesson.
- the reach of the svidomo equal to the material acquired by the scientists.
- Forming a little bit of collectivism and a healthy super-nativity.
- shaping algorithmic thinking.
Wimogi until you know that vmin: - Know types of algorithms.
- Know the understanding: linear, cyclical algorithms, what to understand.
- Vmiti zastosovuvati otrimani nіdnya pіd hour vykonannya practical zavdan.
lesson type: combinations.
Technology: shaping communicative competence
Methods: - Chastkovo-poshukovy, practical;
- informational (verbal);
- Naochno-ilustrative.
Ownership: Flipchart on the topic (addendum 1), computers, resource

Technological card of the student (addendum 2), smart cards (addendum 3), local merezha netop.

Hid lesson

I. Organizational moment.
1. Welcoming children. Hello lads! Sit down! What mood do you have? It's good to laugh at everyone! Yakshto nі - marvel one on one and laugh! Let's finish the lesson! I have presented you with an algorithm for verbal forms. Look at the board. The same algorithm is shown graphically. Today in class we learn from you to present types of algorithms for additional flowcharts (side of flipchart 1).
The epigraph before our lesson will be the words of the famous French scientist Gustave Guillaume "The road is healthy for the one who goes, but the computer science is miserable."
2. Goloshennya goals for the lesson.
II. Updating the knowledge of students

Ale first, let's proceed to the development of new material. We can guess what we were up to at the last lesson.

1. Rechecking homework.
Rewrite crosswords, crosswords at home.

Suggestions:
1. 1. graphic
2. ending
3. information
4. vikonovets
5. algorithm
6. software
7. plan
8. computer
9. tool
10. little ones
11. Croc


Option 1. "Planting a gardener".

Option 2. Episode from the fairy tale "Geese-Swans".

6. Homework.
1. Vivchiti abstract.
2. Draw on A4 format an example of a cyclic algorithm and a block diagram for the proof of the “Kolobok” story.

7. Supply. 1. What types of algorithms are distinguished?
2. Like types of algorithms in the image of a baby.

Addendum No. 3

Resource cards
1. Watch out for task No. 1,2,3 for a resource
Fill in the table with two butts for the skin type of the algorithm.
Fold the algorithm Paint programs, vikoristovuyuchi commands to move and copy.
Option 1. (Flipchart side 25).
"Planting a gardener".
Option 2. (Flipchart side 26).
Episode from the fairy tale "Geese-swans".

There are three types of algorithms - linear, roaming, cyclical.

Linear type of algorithms

Algorithms, for which commands are conjugated one by one, regardless of whether they are minds, are called algorithms of the linear type.

For example, the calculation algorithm is based on the simplest formulas, so that you can not count on the values ​​​​of the change that enter before them.

butt

Problem statement : Calculate the area of ​​the stake, for example, the given radius.

Given : R-radius of the stake.

Know: S - stake area.

Solution: S=3,14R 2

Verbal form record algorithm

Let's select the Russian language for writing to the algorithm in this form and write down the sequence of commands, which, for a given value of the radius, allow us to know the area:

    Read R value.

    Multiply the R value by 3.14.

    Multiply the result of another by the value of R.

    Record the subtractive result of the S value.

My flowchart - Mal. eight

Type of algorithms to be discussed

The solution of problems is not always possible to file with a linear algorithm.

Algorithms, in which it is necessary to organize a selection of sequences and fallow in any kind of minds, are called algorithms of the type that is being developed.

With a graphical method, the layout is organized for an additional logical element (rhombus), which can have one entry and two exits. The purpose of the logical element is the re-verification of the given mind. Fallow in vikonnannya (true) or nevikonannya (hibnosti) mind, what is being misunderstood, it’s possible to look at the needle “So” or “Hi”.

butt

Problem statement : calculate
.

Given: x - the value of the argument.

Know: y - function value.

Solution:

y= x , so x  0

- x yakscho x<0

block diagram - Div. Rice. 9.

Verbal vistava

In pseudocode :

Read x value

If x>0, then

Kіnets razgaluzhennya

Write down the value

see again and again the mental construction .

Cyclic type of algorithms

When folding the algorithms, it is not uncommon to blame the need for repeated repetition of the commands themselves to complete the great stake.

Algorithm, additions to the variant of the bagatarose repetitions of the quiet themselves (cycles), are called cyclical algorithms.

However, “repeatedly” does not mean “to the point of inconsistency”. The organization of cycles, so as not to lead to a grain in the viconan algorithm (the so-called cycle), є damage to its effectiveness.

Under the hour of development, the algorithm of the cyclic structure is seen as follows:

    loop parameter - the value, іz zmіnoyu kakoї pov'yazane bagatorazov vykonannya cycle;

    first and last value of the parameter cycle ;

    croc cycle - value, as the parameter of the cycle changes with skin repetition.

The cyclic algorithm is composed of preparation for the cycle, body for the cycle, wash the continuation of the cycle .

At cycle preparation enter dії, po'yazanі іz zavdannya vyhіdnyh znachenie parametrov cycle (primary and final values, krok parameter).

At body cycle enter: bagatorarazovy repeating dії counting shukanyh values; preparation of the current value of the parameter for the cycle, preparation of other values, the need to re-visit the cycle.

At wash the continuation the need for a distant vikonannya of repeating actions is shown. If the parameter to the cycle has been moved to the last value, the cycle can be attached to the last value.

Let's take a look at the graphical manifestation of the cyclic block to the algorithm (div. Fig. 10).

Cycles can be peredumovaya(if the mind is revered before the cob of the body to the cycle) that z posthumous(If the mind is changed after the first passage of the body to the cycle).

Cycle from postum

Cycle from Peredumovoy

Support the project - share your efforts, darling!
Read also
If apple stop signing ios 10 If apple stop signing ios 10 A look at Xiaomi Mi Smart Scale electronic vags: a stitch behind you A look at Xiaomi Mi Smart Scale electronic vags: a stitch behind you What is the playlist on YouTube and everything about it What is the playlist on YouTube and everything about it