Skip to main content
O-LevelComputer ScienceAlgorithm design and problem-solving2210/22 · Oct/Nov 2020 · Q57 Marks

This pseudocode represents an algorithm. REPEAT Flag ← 0 FOR Count ← 0 to 3 IF Num [Count] < Num [Count + 1] THEN Store ← Num [Count] Num [Count] ← Num [Count + 1] Num [Count + 1] ← Store Flag ← 1 ENDIF NEXT Count UNTIL Flag = 0

  1. (a)The contents of the array at the start of the algorithm are: Num [0] | Num [1] | Num [2] | Num [3] | Num [4] --- | --- | --- | --- | --- 45 | 56 | 30 | 12 | 15 Complete the trace table for the algorithm using the data given in the array. Flag | Count | Num [0] | Num [1] | Num [2] | Num [3] | Num [4] | Store --- | --- | --- | --- | --- | --- | --- | --- | | 45 | 56 | 30 | 12 | 15 |[5]
  2. (b)Describe the purpose of the algorithm.[2]

Mark scheme

Marking points from the official mark scheme (Oct/Nov 2020). The mark or mark type is shown in brackets.

  1. [5] One mark - Flag column
  2. One mark - Count column
  3. One mark - Num [0] and Num [1] columns
  4. One mark - Num [2], Num [3] and Num [4] columns
  5. One mark – Store column
  6. [2] Any two from: The algorithm sorts/orders numbers
  7. ... into descending order / from largest to smallest

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Algorithm design and problem-solving, O-Level Computer Science (syllabus 2210). Structured question, 7 marks.
Source
O-Level Computer Science, Oct/Nov 2020 Paper 2 Variant 2, question 5.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep