Tracing a standard algorithm
A table with a column per variable and a row per step. Use it to test an algorithm such as total, maximum, search or bubble sort by following a short list of values by hand.
Understanding Tracing a standard algorithm in IGCSE Computer Science Paper 2
What it does: In a trace table for one pass, each row shows a comparison and any swap. The largest value moves towards the end. Tracing a maximum, the Max column starts at the first value and changes only when a bigger value is found. A short list lets you record every change of Total by hand, so you can see where an error happens. Bubble sort swaps neighbours when the first is larger than the second. 5 is greater than 3, so they swap. The search checks each item in turn. It matches 7 at position 2, so Found becomes TRUE. Total should be 3, 8, 10. Each row adds the new value to the previous Total, so the final Total is 10.
Common mistakes: Max must start as the first value, Numbers[1]. Tracing 9, 4, 2, 7, 3 with Max starting as 4 gives 7, not 9. It should be Max ← Numbers[1]. The loop adds the counter (1, 2, 3...) instead of the array value. A trace table shows Total as 1, 3, 6... whatever the marks are. It should be Total ← Total + Mark[Index].
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 242–253) and word search (Modules 232–253).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
trace tableFill in the Blanks
Spot the Error
Student with a class code? Join your class →