Presentation on computer science on the topic algorithm. Forms for recording algorithms. Verbal recording method

Algorithm executor

Slides: 8 Words: 170 Sounds: 1 Effects: 2

The concept of an algorithm. The word "algorithm" comes from Latin spelling named after the Arab mathematician al-Khwarizmi (Algorithmi). Al-Khwarizmi first described the rules for performing four arithmetic operations. An algorithm is an accurate and understandable instruction to the performer. Algorithm - perform a sequence of actions on given objects. The executor of the algorithm is a person or device who can perform a certain set actions. The executor is the means of implementing the algorithm. The performer is characterized by: Environment is the environment in which the performer works. The performer is characterized by: The performer's command system is a set of commands understandable to the performer. - Algorithm.ppt

Theory of algorithms

Slides: 20 Words: 890 Sounds: 0 Effects: 18

Algorithms. Sequencing. Executor. Properties of the algorithm. Garbage collection. Ways to describe the algorithm. Create an algorithm for collecting a portfolio. Follow the path indicated by the arrows. Algorithm for preparing any dish. Wolf. Boat. First shore. Types of algorithms. Product of arbitrary numbers. Algorithm. Transition algorithm. Algorithm steps. Algorithm of operation of the machine. Crossing. Way. - Theory of algorithms.ppt

Algorithm and its properties

Slides: 28 Words: 717 Sounds: 0 Effects: 93

Algorithms. Algorithmic language. What is an algorithm? Pour water into the kettle. Sequence of commands. Sequence of steps. Sequencing. Methods of presenting algorithms. Rules for depicting a flowchart. Stepmother. Unambiguity. Limb. Unique interpretation of the rules. Productivity. Clarity. Mass character. Linear algorithms. Linear algorithm. Get ready for school. Tree planting algorithm. Graphics editor. Stages of work. Geometric figures. Sequence of steps in solving a problem. - Algorithm and its properties.ppt

Definition and properties of the algorithm

Slides: 23 Words: 666 Sounds: 0 Effects: 46

Algorithm. Algorithm definitions. Properties of algorithms. Discreteness. Clarity. Certainty. Mass character. Limb. Productivity. Examples of properties. Instructions. Casket. Father. Porridge. Mouse. Executor. Algorithm executor. Characteristics of the performer. Types of algorithms. Ways to describe the algorithm. Recording a sequence of commands. Graphical representation of the algorithm. - Definition and properties of the algorithm.ppt

Algorithm Basics

Slides: 23 Words: 1205 Sounds: 0 Effects: 24

Algorithms: basic concepts. An algorithm is a precise prescription. Properties of the algorithm. Basic ways of writing algorithms. Stages of development and analysis of algorithms. Basic structures data. Important types of tasks. Fundamentals of algorithm efficiency analysis. Measuring the execution time of an algorithm. Growth order. Approximate values ​​of functions important for the analysis of algorithms. Algorithm efficiency in different cases. Asymptotic notation. Strict definition. "Omega". "Theta". Properties of notation. Using limits to compare the order of growth of two functions. Examples. Main efficiency classes. - Basics of algorithms.ppt

Computer Science "Concept of an Algorithm"

Slides: 15 Words: 325 Sounds: 0 Effects: 45

What is an algorithm? Computer. How the computer can be used. Where a computer can be built in. Can a computer solve a problem on its own? Great amount tasks of varying complexity. Stepmother. Algorithm. Only humans can develop algorithms. Material for the curious. Practical task. Stages of work. The final sequence of steps. - Computer Science “The Concept of an Algorithm”.ppt

The concept of an algorithm and its properties

Slides: 24 Words: 967 Sounds: 0 Effects: 0

Algorithm and its properties. The concept of an algorithm. Algorithm – description of a sequence of actions. Each algorithm is created based on the execution of a specific executor. Objects on which the performer can perform actions. Creating an algorithm for solving problems of any type. Algorithmic method human activity. Properties of algorithms. What will happen as a result of executing this algorithm? Chessboard 2x2. Selecting a rectangular area. Chessboard 4x4. Construction of volumetric figures. Create a composition. Sequencing. Which of the following documents is an algorithm? - The concept of an algorithm and its properties.ppt

Algorithmic language

Slides: 32 Words: 3109 Sounds: 0 Effects: 25

Algorithm. Instruction to the performer. Wednesday; elementary actions. Basic properties of algorithms. Forms of presentation of algorithms. Algorithm for finding the greatest common divisor. Graphic representation. Pseudocode. Basic function words. General view of the algorithm. Part of the algorithm. Assignment operator. An example of writing an algorithm. Following. Branching. School algorithmic language. Flowchart language. Cycle. What concepts are used in algorithmic languages? Names. Expressions. Calculations of frequently used functions. Table standard features. Constants. Arithmetic expressions. Examples of writing arithmetic expressions. - Algorithmic language.ppt

Algorithm and algorithmization

Slides: 36 Words: 974 Sounds: 0 Effects: 88

Algorithm. Executor. Rules. Forms for recording algorithms. Verbal form of recording. Block diagram. Program. Types of algorithms. Teams. Linear algorithm. Clean the carpet. Algorithm with branching. Branching. Algorithm with repetition. Repetition. Algorithms in our lives. Blackcurrant marmalade. Algorithms in proverbs. Algorithms in songs. Algorithms in Russian folk tales. Hen. Fairy tale. The episode with the river. The episode with the apple tree. The episode with the stove. The children ran away from Baba Yaga. Grandma baked a bun. The commands are executed one by one. Either one or the other sequence is executed. - Algorithm and algorithmization.ppt

Construction of algorithms

Slides: 12 Words: 679 Sounds: 0 Effects: 70

Algorithms. Way. Algorithm executor. Executor. Detailed description sequences of arithmetic and logical operations. Properties of the algorithm. Methods for writing algorithms. Tools and rules for constructing block diagrams. Connectors. Program design language. A system capable of performing actions. Topics for research. - Construction of algorithms.ppt

Drawing up algorithms

Slides: 19 Words: 519 Sounds: 0 Effects: 78

Computer science. New concepts. Student actions. Algorithm. Entering information. Properties of the algorithm. Condition. Series. Teams. Examples. Boil water. Sort out the beans. Performance. Action. Complete the task according to the algorithm. Harvest the harvest. Algorithm for crossing the road. - Compilation of algorithms.ppt

Executing Algorithms

Slides: 24 Words: 1383 Sounds: 0 Effects: 178

Execution of algorithms for the performer. Executor command system. Free from below. Left is free. Command system. Free on top. Search for an algorithm of minimum length. Calculator. Reverse move. The robot operates on a checkered board. Let's draw. Teams. Shift left. Command code. Action. Type "string". Train. Length. Materials. - Execution of algorithms.ppt

Algorithm Executors

Slides: 15 Words: 494 Sounds: 0 Effects: 86

Decipher the rebus. Algorithm executors. Make a calculation. Dictation. Evaluation criteria. Habitat. Examples of performers are all around us. Executor. Create an algorithm. Calculator. We work at the computer. - Algorithm executors.ppt

Graphic artist

Slides: 13 Words: 359 Sounds: 0 Effects: 54

Graphic educational performer. Situation. Wednesday graphic artist. Two modes. Command system. Work in program mode. Software control. Programming language. Length of vertical and horizontal segments. Letter program. Teams. - Graphic artist.ppt

Algorithm and its formal execution

Slides: 22 Words: 1167 Sounds: 0 Effects: 0

Basics of algorithmization. Algorithm and its properties. Let's take text as an object. Algorithms consist of individual commands. The algorithm should be clear. Recording the algorithm. The initial state of the object. Formal execution of the algorithm. Editing text. Formal model. The computer is an automatic executor of algorithms. Development of programming languages. Programs were written in machine language. Procedural languages. BASIC. Stages of program development. Selecting or developing an algorithm for solving a problem. Top-down design. Coding. Getting the result. Publication or transfer of the work result to the customer. - The algorithm and its formal execution.ppt

Algorithms

Slides: 38 Words: 1169 Sounds: 0 Effects: 43

"Algorithms in our lives." Problem. Formation of algorithmic thinking. Content. Practical part. Research results Conclusion. Purpose of the study: Objectives of the study: Apply the classification of algorithms in the study of computer science. Object of study: “Algorithmization” as a way to develop logical thinking. Subject of research: “Algorithmization” in Computer Science, as a way of classifying algorithms in the surrounding world. A little about the origin. Algorithm. Characteristics of the performer. Algorithm executor. The performer's environment. Elementary actions. Executor command system. - Algorithms.ppt

Algorithm lessons

Slides: 14 Words: 369 Sounds: 0 Effects: 0

The topic of the lesson is “ALGORITHMS”. The steamer hit the shore. The captain shouts: Forward! How can such a bastard be trusted with a steamship? A l g o r i t m In life, we constantly perform different algorithms. We create a daily routine so that we can get a lot done. The concept of an algorithm is one of the fundamental ones in computer science. Examples of algorithms. We follow the rules traffic when crossing the street. Algorithm executors. The algorithm is compiled taking into account the performer. The performer can be a person, an automatic machine, or a computer. Linear. The commands of such an algorithm are executed sequentially from top to bottom. For example, finding the product of four numbers. - Algorithm lessons.ppt

Algorithm of actions

Slides: 18 Words: 341 Sounds: 0 Effects: 86

Algorithms. The appearance of algorithms is associated with the origins of mathematics. The scientific definition of the concept of algorithm was given by A. Church in 1930. IN school course In computer science, you will use the following definition: Algorithm. Discreteness. Mass character. Limb. Productivity. Determinism. Properties of the algorithm. Discreteness: Each individual action and algorithm must be able to be completed. There should be no errors in the algorithm. Description of actions that are performed once in a given order. Linear. Cyclical. Depending on the condition, either one or another sequence of actions is performed. - Algorithm of actions.ppt

What is an algorithm

Slides: 18 Words: 688 Sounds: 0 Effects: 0

Elements of theoretical programming. What is an algorithm? A class of similar problems is called common task When substituting specific values ​​for parameters, we obtain a particular problem. Algorithm. 1. Exact prescription. 2. Clear instructions. 3. Action. And you can name thousands more types of actions. 4. Solve any problem. What does it mean to “solve any problem” from a given class of similar problems? Obtaining a result in a finite number of steps is a property of the effectiveness of the algorithm. And every such set has the property of discreteness. That is why they say that the algorithm has the property of discreteness or discrete structure. - What is an algorithm.ppt

Algorithm command

Slides: 7 Words: 179 Sounds: 0 Effects: 9

Properties of the algorithm. 1.Accuracy. Each command of the algorithm must determine an unambiguous action of the performer. 2. Understandability. Linear algorithm. An algorithm in which commands are executed sequentially one after another is called... Command 1. Command 2. Command n. Branching algorithm. Series 1. Series 2. Condition. Cyclic algorithm. An algorithm in which a series of commands is executed repeatedly is called... Series. Writing flowcharts in ms worde. - Algorithm command.ppt

Action algorithms

Slides: 7 Words: 405 Sounds: 0 Effects: 30

Algorithms in our lives. What will we get as a result? Light the gas. Put the kettle on the fire. Pour water into the kettle. Wait until it boils. Turn off the gas. To complete a task, you first think through a sequence of actions. What is an algorithm? Any algorithm can be depicted graphically or described in words. Both verbal and graphic algorithms must be understandable to the performer. Drawing up a work algorithm is especially important when working on a computer. Where does the word "algorithm" come from? When translated into Latin, the author's name was written as follows: Algorithmi [algorithms]. Let's summarize the lesson. - Action algorithms.ppt

Computer Science 5th grade Algorithm

Slides: 7 Words: 184 Sounds: 0 Effects: 22

Algorithms in our lives. Laboratory work. Beginner course. Answer the questions: What new concept have we learned? Algorithm What is an algorithm? Description of the sequence of actions. How can you depict the algorithm? Describe in words or depict a sequence of actions in the form of pictures. How should the algorithm be described? How should the algorithm be executed? Strictly observing the sequence of actions. Let's repeat the ways of writing algorithms. Any algorithm can be depicted graphically or described in words. Graphical algorithm. Write a verbal description orally graphical algorithm. - Computer Science 5th grade Algorithm.ppt

Algorithms in computer science

Slides: 17 Words: 404 Sounds: 1 Effects: 83

Types of algorithms. Algorithms can be described: verbally; tabular; using the program; graphically. Standard graphic objects block diagrams. Indication of the beginning and end of the algorithm. Organization of data input and output. Performing an action or group of actions. Selecting the direction of execution of the algorithm depending on the fulfillment of the condition. Usage auxiliary algorithms. Types of algorithms. Linear. Branching. Cyclical. Linear algorithm. We meet the linear algorithm in the fairy tale “Little Red Riding Hood” by Charles Perrault. Action1. Action2. Action N. Output the result. Entering initial data. - Algorithms in computer science.ppt

Algorithm properties

Slides: 22 Words: 289 Sounds: 0 Effects: 0

Lesson plan. Examination homework New material “Algorithms” Problem solving Testing. Seeding algorithm prime numbers(Sieve of Eratosthenes). Testing. "Definition and properties of algorithms". Any sequence of actions is an algorithm. A strict sequence of a finite number of actions is an algorithm. The algorithm must necessarily be executed in a specific (certain) number of steps. An algorithm can be developed for any problem. Algorithmization is a mandatory stage for solving a problem using a computer. The “discreteness” property indicates the possibility of dividing the algorithm into separate steps. - Algorithm properties.ppt

Properties and types of algorithms

Slides: 9 Words: 305 Sounds: 0 Effects: 0

Types of algorithms. Properties of algorithms: Graphic method descriptions of the algorithm (block diagram). The beginning, the end of the algorithm. Condition for performing an action. The action being performed. Sequence of actions. Linear algorithm. Incomplete form of a branched algorithm. Full form of the branched algorithm. A cyclic algorithmic design in which the condition is set at the beginning of the cycle. A cyclic algorithmic design in which a condition is placed at the end of the cycle. - Properties and types of algorithms.ppt

Algorithm concept

Slides: 9 Words: 149 Sounds: 10 Effects: 29

Formalization of the concept of an algorithm. Algorithm (lat. algorithmi - al Khorezmi - cf. Asian mathematician of the 9th century). The algorithm is always designed to be executed by a non-reflective performer - formal execution of the algorithm. There are tasks for which you need to create formal algorithm almost impossible. Properties of algorithms. Discreteness Determinism Effectiveness Massiveness. The definition of an algorithm is an intuitive concept and not a strictly mathematical one. The need to clarify the concept of an algorithm. It was not possible to construct algorithms, and the concept of an algorithmically unsolvable problem arose. - Concept of algorithm.ppt

Algorithm basic concepts

Slides: 40 Words: 6786 Sounds: 0 Effects: 9

Algorithms: basic concepts, examples of practical development. Intuitive concept of an algorithm. Input data for tasks of the same type. Computer using an algorithm for solving a problem of this type. Result. Key concepts. An executor who does not understand the purpose of the algorithm is called a formal executor. The commands of such an algorithm are executed in a natural sequence, unless otherwise stated. The order of actions is indicated by arrows. Writing algorithms using flowcharts is regulated by GOST. Linear structure algorithms: actions are performed sequentially one after another. - Algorithm basic concepts.ppt

Algorithm as an activity model

Slides: 12 Words: 640 Sounds: 0 Effects: 40

Algorithm as a model of activity. What is an algorithmic model? But every plan or description is an information model. Therefore: The algorithm is information model performer's activities. Algorithmic model: Defining the goal (setting tasks). Construction of a plan - algorithm. Performer's work. Getting the result. Model of the performer's work. When composing an algorithm, one must not go beyond the framework of the SKI. A programming language is a formalized language for describing algorithms. An example of an algorithmic model. Algorithm trace – model of processor operation. By performing manual tracing, a person simulates the operation of the processor. - Algorithm as an activity model.ppsx

Algorithmization Basics

Slides: 11 Words: 286 Sounds: 0 Effects: 73

Basics of algorithmization. Definition Methods of description Types of algorithms. Here you can read the basics about algorithms. An algorithm is a finite sequence of commands to the performer. Verbal form of recording - the algorithm is written in words and is intended for humans. Program Amount Description a,b,c:Integer End_of_description a:=5 c:=9 c:=a+c Output ('sum= ', c) End_of Program. Linear algorithm. Branching algorithm. Algorithm with repetition. - Basics of algorithmization.ppt

Execution of algorithms by computer

Slides: 12 Words: 208 Sounds: 0 Effects: 67

Computer as a formal executor of algorithms (programs). Basic questions: Formal executor Algorithm and program Features of program execution. Formal performer. Data. Program. Solution. Result. Algorithms and programs. Executor. Team. Executor Command System (SCI). The composition of the YaMK teams was proposed by John von Neumann in 1946. Computer. Ski. Machine Command Language (MCL). Each command is a directive for the processor to perform a specific action. Input device. Output device. CPU. RAM. Stages of program execution. - Execution of algorithms by computer.ppt

Algorithms assignments

Slides: 25 Words: 798 Sounds: 0 Effects: 17

1. Select the File? Save as. 2. In the window that opens, select the desired folder. 3. In the “Name” field, specify the file name. 4. Click the “Save” button. Algorithms. From the history. In translation, any rule began with the words: “The algorithm said.” Algorithm for sending SMS. Step by step. Consistently. It's clear. Leads to the goal. Algorithm. Only a person can develop an algorithm! Create an algorithm for collecting a portfolio. 1. View the schedule. 2. Remove everything unnecessary from your briefcase. 3. Place textbooks and notebooks according to the schedule. 4. Check the pencil case. 5. Put down the diary. Before you are problems for which you need to create an algorithm. -


  • Algorithms can describe the transformation processes of a wide variety of objects. The word “algorithm” itself comes from “algorithmi” - the Latin spelling of the name of the outstanding 9th century mathematician al-Khwarizmi, who formulated the rules for performing arithmetic operations.
  • Algorithm- a set of commands that describe the order of actions of the performer to achieve the result of solving a problem in a finite number of actions.

Properties of algorithms:

1. Discreteness- the algorithm must represent the process of solving a problem as the sequential execution of certain simple steps. Wherein each step of the algorithm requires a finite amount of time to complete, that is, the transformation of source data into results is carried out discretely in time.

2. Determinism (certainty). At every moment of time next step work is uniquely determined by the state of the system. Thus, the algorithm produces the same result (answer) for the same initial data.


3. Clarity- the algorithm should include only those commands that are available to the performer and are included in his command system.

4. Completeness (extremity)- with correctly specified initial data, the algorithm must complete its work and produce a result in a finite number of steps.

5. Mass character (universality). The algorithm must be applicable to different sets of input data.

6. Effectiveness- completion of the algorithm with certain results.


Ways to write algorithms:

1. Verbal recording method

The verbal way of writing algorithms is a description of the successive stages of data processing. The algorithm is specified in an arbitrary presentation in natural language .

Example

As an example of a verbal way of writing an algorithm, consider an algorithm for finding the area of ​​a rectangle

where S is the area of ​​the rectangle; a, b – the lengths of its sides.

Obviously, a, b must be specified in advance, otherwise the problem cannot be solved.


Ways to write algorithms

The verbal way of writing the algorithm looks like this:

  • The beginning of the algorithm.
  • Set the numerical value of side a.
  • Set the numerical value of side b.
  • Calculate the area S of the rectangle using the formula S=a*b.
  • Output the result of calculations.
  • End of the algorithm.

Ways to write algorithms

2. Graphic method

When presented graphically, the algorithm is depicted as a sequence of interconnected functional blocks, each of which corresponds to the execution of one or more actions.

This graphical representation called an algorithm diagram or flowchart. In the flowchart, each type of action (entering initial data, calculating the values ​​of expressions, checking conditions, controlling the repetition of actions, completing processing, etc.) corresponds geometric figure, represented as a block symbol. Block symbols are connected by transition lines that determine the order in which actions are performed. The following are the most commonly used symbols.


Ways to write algorithms

Flowchart element

Name

Computation block (computational block)

Computational actions or sequence of actions

Logic block (condition block)

Data input/output block

Choosing the direction of algorithm execution depending on some condition

General designation for data input (output) (regardless of physical media)

Beginning (end)

Beginning or end of an algorithm, entry or exit in a subroutine


Ways to write algorithms

Flowchart element

Name

User process (subroutine)

Calculation by standard program or subroutine

Modification block

The function performs actions that change points (for example, the loop header) of the algorithm

Connector

Indicating the connection by broken lines between information flows


Ways to write algorithms

Example

Algorithm for calculating the area of ​​a rectangle


Ways to write algorithms

3. Pseudocodes

semi-formalized descriptions of algorithms in a conditional algorithmic language, including both elements of a programming language and natural language phrases, generally accepted mathematical notations, etc.

There is no single or formal definition of pseudocode, so various pseudocodes are possible, differing in the set of function words and basic (basic) constructions.


Ways to write algorithms

Example

  • Start. Go to point 2.
  • Entering numbers a and b. Go to point 3.
  • Calculate S=a*b. Go to point 4.
  • Conclusion S. Go to point 5.
  • End.

Ways to write algorithms

4. Software method

Recording the algorithm in the selected programming language.

Example

Writeln('');

Writeln('S=', S);


Types of algorithms

1. Linear algorithm

This is an algorithm in which there is only a following structure.

Following- This is the arrangement of actions one after another.


Types of algorithms

2. Branching algorithm (if... then... otherwise...)

This is an algorithm that has a branching structure.

Branching- this is the choice of action depending on the fulfillment of some condition.


Types of algorithms

3. Cyclic algorithm

This is an algorithm that has a loop structure.

Cycle- This is the repeated repetition of any action.


Types of algorithms

4. Combined algorithm

An algorithm that contains several structures simultaneously.


1 slide

2 slide

CONTENTS OF PRESENTATION History. The concept of algorithm. Examples of algorithms. Algorithm executors. What is a program? Properties of the algorithm. Types of algorithms. Methods for describing algorithms. Main blocks graphic description algorithm. Home © Nechaeva Olga Ivanovna 2006 History of origin. The concept of algorithm. Examples of algorithms. Algorithm executors. What is a program? Properties of the algorithm. Types of algorithms. Methods for describing algorithms. The main blocks of a graphical description of the algorithm. To main

3 slide

A LITTLE HISTORY The founder of algebra, the term “algorithm” comes from his name. In world science he was known for his treatise on mathematics, based on the positional principle. Thanks to the translation of this work from Arabic into Latin, “Arabic” numbers entered world mathematics forever. The author's name in the Latinized form Algorismus and Algorithmus originally gave the name to the rules of four arithmetic operations, with decimal system Reckoning. Subsequently, the word “algorithm” began to mean any regular process that, in a finite number of steps, provides a solution to a certain class of problems. Al-Khorezmi (786-850 AD) - © Nechaeva Olga Ivanovna 2006

4 slide

An algorithm is a set of execution rules certain actions, providing a solution to the problem. A L G O R I T M In life, we constantly perform different algorithms. © Nechaeva Olga Ivanovna 2006 We create a daily routine in order to get a lot done. The concept of algorithm is one of the fundamental ones in computer science.

5 slide

EXAMPLES OF ALGORITHMS We take out a cookbook and strictly follow the recipe written in it so that the dish is successful and you can treat your friends. We follow traffic rules when crossing the street. © Nechaeva Olga Ivanovna 2006

6 slide

PERFORMERS OF ALGORITHMS The algorithm is compiled taking into account the performer. The performer can be a person, an automatic machine, or a computer. © Nechaeva Olga Ivanovna 2006

7 slide

PROGRAM © Nechaeva Olga Ivanovna 2006 Each performer has his own command system (SCS). A program is an algorithm written in the language of the performer. Let's look at an example: take educational performer Turtle. Let this performer have three commands: forward (1 cm), right (900), left (900). Initial position performer: The program code will look like this: left (900) forward (1 cm) forward 1 cm right (900) forward (1 cm) What program code should be written for the Turtle to draw the letter G?

8 slide

© Nechaeva Olga Ivanovna 2006 PROPERTIES OF THE ALGORITHM (Requirements for compiling the algorithm) Discreteness. The process of solving a problem must be divided into a sequence of individual steps. Unambiguousness (accuracy). The algorithm's commands must be precisely defined (for example, you cannot write 3-4 cups of flour, you must specify 3 cups). Productivity. After executing all the commands of the algorithm, the result should be obtained. Universality (mass appeal). Important property when solving problems on a computer. The algorithm must be applicable to solve any specific task, but for a certain class of problems. For example, to solve a quadratic equation with different coefficients). Clarity. The algorithm must be written in a language understandable to the performer.

Slide 9

Linear. The commands of such an algorithm are executed sequentially from top to bottom. For example, finding the hypotenuse of a right triangle using its two legs. TYPES OF ALGORITHMS © Nechaeva Olga Ivanovna 2006 Branching. Depending on the conditions set, the algorithm allows you to choose one of the options for solving the problem. Examples could be finding the roots of a quadratic equation or a hero at a crossroads from Russian fairy tales. Cyclical. The algorithm contains repetitive actions. For example, when memorizing a poem, you have to reread and repeat the same lines.






Linear algorithm The simplest problems have a linear solution algorithm (they have a “following” structure). The linear structure algorithm is a sequence of actions and does not contain any conditions. Thus, in such algorithms all stages of solving a problem are performed strictly sequentially.




Cyclic algorithms A cycle is a repeated repetition of actions. Cyclic algorithms With post condition - In this loop, the condition is checked from the beginning, then the action occurs. With pre condition - Here the action occurs at the beginning, then the condition is checked by the condition.








Linear algorithm Program pokupka; Usescrt; Var a, b, d, den: real; ostatok: real; begin clrscr; write("enter the cost of gloves, briefcase and tie"); readln(a, b, d); write("enter the amount of money you have"); readln(den); oststok:= den – a – b – c; writeln ("after purchase you will have ", ostatok:5:2, "rub."); readln; end.


Y then writeln (x) (if x is greater than y, then print x) else writeln (y) (otherwise we print" title="Branching algorithm Program (name); Var x, y: integer; (input numbers) Begin writeln("Введите 2 числа "); {вводим два целых числа через пробел} readln(x,y); if x>y then writeln (x) {если х больше y, то выводим х} else writeln (y) {иначе выводим" class="link_thumb"> 11 !} Branching algorithm Program (name); Var x, y: integer; (entered numbers) Begin writeln("Enter 2 numbers "); (enter two integers separated by a space) readln(x,y); if x>y then writeln (x) (if x is greater than y, then print x) else writeln (y) (otherwise print y) End. y then writeln (x) (if x is greater than y, then output x) else writeln (y) (otherwise output"> y then writeln (x) (if x is greater than y, then output x) else writeln (y) (otherwise output y) End."> y then writeln (x) (if x is greater than y, then print x) else writeln (y) (otherwise print" title="Branching algorithm Program (name); Var x, y: integer; (input numbers) Begin writeln("Введите 2 числа "); {вводим два целых числа через пробел} readln(x,y); if x>y then writeln (x) {если х больше y, то выводим х} else writeln (y) {иначе выводим"> !}
y then writeln (x) (if x is greater than y, then print x) else writeln (y) (otherwise we print" title="Branching algorithm Program (name); Var x, y: integer; (input numbers) Begin writeln("Введите 2 числа "); {вводим два целых числа через пробел} readln(x,y); if x>y then writeln (x) {если х больше y, то выводим х} else writeln (y) {иначе выводим"> !}