An algorithm is a precise, step-by-step set of instructions that solves a problem or completes a task. All algorithms must be:
Algorithms are the foundation of all computer programs. They are independent of any programming language.
Computational thinking is a problem-solving approach that involves four key techniques:
| Technique | Description | Example |
|---|---|---|
| Decomposition | Breaking a complex problem into smaller, more manageable sub-problems | Breaking "make a website" into: design, front-end, back-end, testing |
| Abstraction | Removing unnecessary detail and focusing only on the relevant aspects | A map shows roads but not every tree — unnecessary detail is hidden |
| Pattern recognition | Identifying similarities or patterns that can be used to solve similar problems | Recognising that sorting a list of names uses the same logic as sorting numbers |
| Algorithm design | Developing a step-by-step solution to a problem | Writing pseudocode to describe a sorting algorithm |
Algorithms can be represented in different ways:
Pseudocode is an informal, human-readable way to describe an algorithm using structured language (similar to a programming language but without strict syntax). Cambridge uses its own pseudocode style.
total ← 0
FOR i ← 1 TO 10
INPUT number
total ← total + number
NEXT i
OUTPUT total / 10
Flowcharts use standard symbols to visually represent an algorithm:
| Symbol (shape) | Meaning |
|---|---|
| Oval/Rounded rectangle | Start / End (Terminator) |
| Rectangle | Process (action, calculation) |
| Diamond | Decision (yes/no question) |
| Parallelogram | Input / Output |
| Arrow | Flow of control (direction) |
All algorithms are built from three fundamental structures:
A variable is a named location in memory that stores a value that can change during program execution. A constant is a named value that does not change. In Cambridge pseudocode, assignment uses the ← symbol:
score ← 0 MAX_SCORE ← 100 score ← score + 10
5 questions · 12 marks
| Term | Definition |
|---|
10 minutes · mixed marks