Mind map
Algorithm Constructs
Map content
Algorithm Constructs
Sequence
- A number of instructions that are processed one after the other.
- For example, a very simple algorithm for brushing teeth might consist of these steps.
- . Put toothpaste on toothbrush . Use toothbrush to clean teeth . Rinse toothbrush
- Each step is an instruction to be performed. Sequencing is the order in which the steps are carried out.
- Sequencing is important since it is crucial that the steps in an algorithm are performed in the right order - otherwise the algorithm will not work correctly.
- For example, a very simple algorithm for brushing teeth might consist of these steps.
- A number of instructions that are processed one after the other.
Iteration
- FOR Loop
- Used when something is repeated over and over again, so anything where the program goes round in a loop.
- e.g. DECLARE count SET count TO 0 FOR count = 1 to 10 OUTPUT count END FOR OUTPUT ‘finished’
- Typically programmed using code such as WHILE, REPEAT and FOR statements. See the example of Pseudocode using a FOR loop to write out numbers 1 to 10:
- NOTE: A FOR loop is used when it is known exactly how many times to go round the loop.
- Used when something is repeated over and over again, so anything where the program goes round in a loop.
- WHILE Loop
- In comparison, a WHILE loop is used to repeat while a condition is true or false. In this example, the WHILE loop will loop until a pile of items are all counted
- e.g. DECLARE count SET count TO 0 WHILE (there are items in a pile) ADD 1 TO count END WHILE OUTPUT the number of items
- In comparison, a WHILE loop is used to repeat while a condition is true or false. In this example, the WHILE loop will loop until a pile of items are all counted
- FOR Loop
Modularisation
- Used to reduce the complexity of a system by deconstructing it into independent units or modules.
Selection and Condition
- Uses a condition to select, or determine, the next line of the program that is to be executed
- These statements help to make decisions and change the flow of a program. In many languages, there are two types of selection statements:
- IF Statement
- The 'if' statement is one of the most basic and simplest controls flow statements. We can use the ‘if’ statement when we want to execute a group of one or more script statements only when a particular condition is met.
- IF ELSE Statement
- As we know, the ‘if’ statement allows us to execute a set of statements only when a particular condition is true. However, if we want to execute another set of statements when the condition is false, then we can use the ‘if / else’ statement.
- e.g. CALCULATE totalCost IF (totalCost > $10) THEN OUTPUT 'no delivery charge' ELSE OUTPUT '$5 delivery charge' ENDIF OUTPUT 'thankyou'
- IF Statement
- These statements help to make decisions and change the flow of a program. In many languages, there are two types of selection statements:
- Uses a condition to select, or determine, the next line of the program that is to be executed
Assignment
- Used to store the value of an expression into a variable.
- They are similar to the variables that you would have seen in maths (e.g. x=5).
- In programming, this is exactly the same idea, except computers can remember anything not just numbers. Additionally, the variables are generally given more meaningful names that relate to the data they contain e.g. studentName = "Tom".
- e.g. DECLARE studentName SET studentName TO Bob
- Assignment is the way that a variable is told to remember a certain value.
- Used to store the value of an expression into a variable.
Information
- Description
- Mind Map on Algorithm Constructs, created by Noah Park on 20/04/2026.
- Created by
- Noah Park
- Views
- 0
- Rating