Skip to main content
A-LevelComputer ScienceAlgorithm design and problem-solving9618/23 · May/June 2021 · Q58 Marks

A global 2D array Result of type INTEGER is used to store a list of exam candidate numbers together with their marks. The array contains 2000 elements, organised as 1000 rows and 2 columns. Column 1 contains the candidate number and column 2 contains the mark for the corresponding candidate. All elements contain valid exam result data. A procedure Sort() is needed to sort Result into ascending order of mark using an efficient bubble sort algorithm. Write pseudocode for the procedure Sort().

  1. A procedure Sort() is needed to sort Result into ascending order of mark using an efficient bubble sort algorithm. Write pseudocode for the procedure Sort().[8]

Mark scheme

Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.

  1. [1] Outer loop
  2. [1] Inner loop
  3. [1] Correct comparison in a loop
  4. [1] Correct swap of col1 array elements in a loop
  5. [1] Correct swap of col2 array elements in a loop (via loop or separate statements)
  6. [1] 'NoSwap' mechanism: Conditional outer loop including flag reset
  7. [1] 'NoSwap' mechanism: Set flag in inner loop to indicate swap
  8. [1] Reducing Boundary in the outer loop

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, A-Level Computer Science (syllabus 9618). Structured question, 8 marks.
Source
A-Level Computer Science, May/June 2021 Paper 2 Variant 3, 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