Understand sequence, decision and repetition in algorithm design
Key knowledgeUnderstand sequence, decision and repetition in algorithm design.
Build the idea
Precise pseudocode identifies stored quantities and an unambiguous next action. Sequence executes instructions in order, selection chooses a branch and repetition revisits a block. A terminating algorithm also needs a quantity that cannot decrease forever. The Euclidean algorithm illustrates these features while preserving the required greatest common divisor.
Try the sample task
Trace this pseudocode for a=84,b=30: WHILE b≠0: r=a mod b; a=b; b=r. RETURN a. Give every pair (a,b) after an iteration and the returned value.
The full worksheet includes the worked solution and remaining task set.
What this activity covers
These tasks develop selected examples of the requirement. Further examples and the associated Area of Study content are needed for full course coverage.