An algorithm is a precise, step-by-step set of instructions for solving a problem or completing a task in a finite number of steps. Every algorithm must:
Cambridge 9618 uses a structured approach to computational problem-solving:
Abstraction is the process of removing or hiding unnecessary detail to focus on what is important for solving the problem. It allows complex real-world problems to be represented in a manageable way.
Example: when designing an algorithm to find the shortest route between two cities, we abstract the real world to a graph — cities become nodes, roads become weighted edges. The actual geography, traffic signals, and roadworks are stripped away.
Decomposition means breaking a complex problem into smaller sub-problems that are easier to solve. Each sub-problem can then be solved, coded, and tested independently, then combined. This is the foundation of modular programming.
Example decomposition of a school management system:
Each of these can be further decomposed into smaller procedures.
Cambridge 9618 uses a specific pseudocode style. Key conventions:
← (e.g., x ← 5)= (e.g., IF x = 5)OUTPUTINPUTFOR i ← 1 TO 10 ... NEXT iWHILE condition DO ... ENDWHILEREPEAT ... UNTIL conditionPROCEDURE name(params) ... ENDPROCEDUREFUNCTION name(params) RETURNS type ... ENDFUNCTIONA trace table is used to manually execute (dry-run) an algorithm, recording the value of each variable at each step. Used to:
Cambridge exam questions often ask you to complete a trace table for a given algorithm — you must show each variable's value changing as each instruction executes.
| Property | Meaning | Why it matters |
|---|---|---|
| Correctness | Produces correct output for all valid inputs | An incorrect algorithm is useless however fast it runs |
| Efficiency | Uses minimal time and memory resources | Poor efficiency fails at scale (billions of inputs) |
| Clarity | Easy to read, understand and maintain | Real software must be maintained by teams over years |
| Generality | Works for the full problem class, not just one example | A solution for only one specific input is not useful |
| Finiteness | Terminates in a finite number of steps | An infinite loop is not an algorithm |
= for assignment — Cambridge uses ← for assignment and = only for comparison6 questions · instantly marked · Cambridge 9618 standard
FOR i = 1 TO 5
total = total + i
END FOR[2]total ← total + i [1]; Error 2: loop counter variable i should use ← not = — should be FOR i ← 1 TO 5 [1]; Error 3 (bonus): loop terminator should be NEXT i not END FOR [1] (accept any 2 of these 3).| Term | Definition |
|---|
10 questions · 10 marks · 10 minutes