What an algorithm is
An algorithm is a precise set of steps that solves a problem. A recipe is an algorithm. So is the route you follow to school. In Computer Science, the steps have to be exact enough that a computer could follow them without guessing.
At GCSE you need to read algorithms, write them in pseudocode or a programming language, trace them, find and fix errors, and compare how efficient they are.
Computational thinking
Every algorithm question builds on three skills:
- Decomposition: breaking a problem into smaller parts you can solve one at a time.
- Abstraction: removing detail that does not matter, so you can focus on what does.
- Algorithmic thinking: putting the steps in the right order, with the right decisions and repetition.
The three building blocks
Every algorithm, however long, is built from three structures.
Sequence
Steps run one after another, in order.
Selection
A decision: IF something is true, do one thing, ELSE do another.
Iteration
Repetition: a FOR loop runs a set number of times, a WHILE loop runs until a condition changes.
Searching: linear search
A linear search checks each item in turn, from the start, until it finds the target or reaches the end. It works on any list, sorted or not, but it can be slow on a long list.
Try it below. Each step compares one item with the target.
Trace tables
A trace table records the value of each variable as an algorithm runs, one row at a time. It is one of the most common exam questions, and one of the easiest to get full marks on once you have a method.
total ← 0
FOR i ← 1 TO 4
total ← total + i
ENDFOR
OUTPUT total
| i | total | Output |
|---|---|---|
| – | 0 | |
| 1 | 1 | |
| 2 | 3 | |
| 3 | 6 | |
| 4 | 10 | |
| 10 |
- Write one column for every variable, plus one for output.
- Work through the code line by line. Only write a value when it changes.
- Check the loop's start and end values carefully. Most lost marks are off by one.
Sorting
You need to know how bubble sort, merge sort and insertion sort work, trace them on a short list, and compare them. The GCSE Algorithm Cheat Sheet has each one step by step, with an interactive bubble sort and binary search.
How Dee teaches algorithms
- Every algorithm is shown visually before any pseudocode.
- Real exam-style questions in every session, using your exam board's notation.
- Mark scheme thinking: what earns marks and what loses them.
- The same idea practised with different questions until it sticks.

