Question 2(c) 2021 · May-June · Paper 42 · 6 marks
Reveal official mark-scheme answer

Official answer for Question 2
Part (c)
Question 1
mark per bullet point
Question 6
- Correct outer loop stop
- Correct inner loop stop
- Correct < in the IF
- Correct theArray(y + 1)
- Correct temp
- Remainder matching pseudocode
Show text version of question
Question 2
Part (c)
Question 2
A program stores the following ten integers in a 1D array with the identifier arrayData.
Part (c)
The following bubble sort pseudocode algorithm sorts the data in theArray into descending
numerical order. There are five incomplete statements.
PROCEDURE bubbleSort()
DECLARE temp : INTEGER
FOR x 0 to …………………………………
FOR y 0 to …………………………………
IF theArray[y] ………………………………… theArray[y + 1] THEN
temp theArray[y]
theArray[y] …………………………………
theArray[y + 1] …………………………………
ENDIF
NEXT y
NEXT x
ENDPROCEDURE
Write program code for the procedure bubbleSort() to sort the data in arrayData into descending order.
Save your program.
Copy and paste the program code into part 2(c) in the evidence document.
Question 8
Why this question appears here
82% assigned-topic match · Algorithm design and problem-solving › Algorithms
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s21_qp_42.pdf
