What is an algorithm, and how do flowchart symbols show its steps and decisions?
Define an algorithm and represent its sequence, selection and iteration using standard flowchart symbols
A focused answer to the O-Level Computing point on algorithms and flowcharts. What an algorithm is, the standard flowchart symbols, and how to show sequence, selection and iteration in a flowchart.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
SEAB wants you to define an algorithm and to draw its logic with the standard flowchart symbols, showing the three control structures: sequence, selection and iteration. The central idea is that any task can be broken into ordered steps, and a flowchart is a diagram that makes those steps, decisions and repetitions easy to see and check.
The answer
What an algorithm is
An algorithm is a step-by-step set of instructions for solving a problem. A good algorithm is:
- Ordered: the steps run in a definite sequence.
- Unambiguous: each step has one clear meaning.
- Finite: it ends after a limited number of steps.
A recipe is an everyday algorithm: clear steps, in order, that finish with a result.
The three control structures
Every algorithm is built from three structures:
- Sequence: steps done one after another.
- Selection: a decision that chooses between paths.
- Iteration: a loop that repeats steps.
Standard flowchart symbols
| Symbol | Shape | Use |
|---|---|---|
| Terminator | rounded box | Start and Stop |
| Process | rectangle | a calculation or action |
| Input/Output | parallelogram | reading input or showing output |
| Decision | diamond | a yes/no question (two exits) |
| Flow line | arrow | the order to follow |
Showing selection
A decision diamond asks a yes/no question. It has two exits, labelled Yes and No, and the flow follows one branch or the other. The branches usually rejoin afterwards.
+-----------+
| x > 0 ? |
+-----------+
Yes / \ No
/ \
"Positive" "Not positive"
Showing iteration
A loop is drawn by sending a flow line back to an earlier point, guarded by a decision. While the decision keeps answering Yes, the steps repeat; when it answers No, the flow moves on. This is how a flowchart shows a "repeat until" or "while" loop.
Examples in context
Example 1. A vending machine. The machine follows an algorithm: take money (input), check if enough has been paid (decision), and either dispense the item (process and output) or ask for more (loop back). Drawing it as a flowchart shows exactly where the decision and the loop sit.
Example 2. Sorting the post. A worker following "if the letter is local, put it in tray A, otherwise tray B, and repeat for every letter" is running selection inside iteration. A flowchart with a decision diamond inside a loop captures the same logic before any code is written.
Try this
Q1. Name the flowchart symbol used for input and output. [1 mark]
- Cue. A parallelogram.
Q2. State the three control structures used to build algorithms. [3 marks]
- Cue. Sequence, selection and iteration.
Q3. Explain why a decision symbol has two exits. [2 marks]
- Cue. It asks a yes/no question, and the flow must follow a different path for each answer.
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original4 marks(a) Define the term algorithm. (b) Name the flowchart symbol used for a decision, and explain how many exits it has and why.Show worked answer →
(a) An algorithm is a step-by-step set of instructions for solving a problem or completing a task, written so that each step is clear and unambiguous and the steps are carried out in a definite order.
(b) The decision symbol is a diamond (a rhombus). It has two exits, usually labelled Yes and No (or True and False), because a decision asks a question with a yes-or-no answer and the flow must follow a different path depending on the result.
Markers reward a clear definition (ordered, unambiguous steps to solve a problem) and the diamond decision symbol with two labelled exits.
Original5 marksDescribe, using the correct flowchart symbols, an algorithm that asks the user for a number, then prints 'Positive' if the number is greater than and 'Not positive' otherwise. State the symbol used at each stage.Show worked answer →
The flow uses four kinds of symbol in order:
- Terminator (rounded box): Start.
- Input/output (parallelogram): input the number.
- Decision (diamond): is the number greater than ? This has two exits.
- Input/output (parallelogram) on each branch: the Yes branch outputs "Positive"; the No branch outputs "Not positive".
- Terminator (rounded box): both branches join and reach Stop.
The decision is the selection; everything else is sequence.
Markers reward the terminator, input/output and decision symbols used correctly, two branches from the diamond, and the branches rejoining before Stop.
Related dot points
- Write algorithms in pseudocode using input, output, assignment, selection (IF) and iteration (WHILE, FOR)
A focused answer to the O-Level Computing point on pseudocode. Writing algorithms with input, output, assignment, IF selection, and WHILE and FOR loops, in clear language-independent steps.
- Describe and trace linear search and binary search, and explain why binary search needs a sorted list
A focused answer to the O-Level Computing point on searching. How linear search checks each item in turn, how binary search halves a sorted list each step, and why binary search is faster but needs sorted data.
- Describe and trace the bubble sort, explaining how repeated passes of comparisons and swaps sort a list
A focused answer to the O-Level Computing point on sorting. How bubble sort compares neighbouring items and swaps them, how each pass moves the largest value to the end, and tracing the algorithm by hand.
- Use a trace table to follow variable values through an algorithm, and choose normal, boundary and invalid test data
A focused answer to the O-Level Computing point on tracing and testing. Building a trace table to track variables through an algorithm, and choosing normal, boundary and invalid test data to find errors.
- Use Python selection with if, elif and else, build conditions with comparison and logical operators, and order branches correctly
A focused answer to the O-Level Computing point on Python selection. Using if, elif and else, comparison operators, combining conditions with and, or and not, and ordering branches so each value falls into the right one.