Past-paper question · 2024 February-March · Paper 22 · Q3(b)

Question 3(b) 2024 · February-March · Paper 22 · 4 marks

Original past-paper question for 3(B)
Original past-paper question for 3(B)
Reveal official mark-scheme answer Official mark-scheme answer for 3(B)

Official answer for Question 3

Part (b)

✓
One mark for each point max four.

Question 4

  • use of inner and outer loop
  • correct use of loops
  • checking adjacent values in array …
  • ... swap if required
  • correct stopping condition
✓
Last 50
✓
Repeat
✓
Swap FALSE
✓
FOR Index 1 TO Last - 1
✓
IF Values[Index] > Values[Index + 1]
✓
THEN
✓
Temp Values[Index]
✓
Values[Index] Values[Index + 1]
✓
Values[Index + 1] Temp
✓
Swap TRUE
✓
ENDIF
✓
NEXT
✓
Last Last - 1
✓
UNTIL NOT Swap or Last = 1
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_m24_ms_22.pdf →

Show text version of question

Question 3

Part (b)

Question 3

A linear search and a bubble sort are standard methods of solution.

Fifty numbers are already stored in the array Values[1:50]

Part (b)

Write an algorithm in pseudocode to sort the array Values[1:50] into ascending order

using a bubble sort.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[4]
Topic relevance

Why this question appears here

98% assigned-topic match · Algorithm design and problem-solving

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 0478_m24_qp_22.pdf

Keep practising this topic