OCR GCSE Computer Science Paper 2, June 2025: question 3

A PrepWise guide to a real paper, with our descriptions and answers. Not made or approved by OCR.

PrepWise guide: OCR GCSE Computer Science Paper 2Question 33 of 6

The eight numbers in Figure 5 must be put in ascending order. A different task searches an array: it looks at the first item, halts if that item is the target, and otherwise goes on to the next item.

Figure 5
A list of eight whole numbers separated by commas.Open full size to read the labels (Figure 5, opens in a new tab)
03.1[4 marks]

Show each stage of a merge sort that sorts the numbers in Figure 5 into ascending order.

See how you would score on Merge Sort

Our own questions on this topic, marked straight away, so you see what to revise. Free now.

Show model answer for 03.1Hide model answer for 03.1
Divide
[2 7 3 1 9 6 5 4]
[2 7 3 1] [9 6 5 4]
[2 7] [3 1] [9 6] [5 4]
[2] [7] [3] [1] [9] [6] [5] [4]

Merge
[2 7] [1 3] [6 9] [4 5]
[1 2 3 7] [4 5 6 9]
[1 2 3 4 5 6 7 9]
4 marks

How the marks are earned

  1. One mark for each stage, up to 4. Brackets are not needed, but it must be clear which numbers form each group of 2, 4 or 8.
  2. BP1: the list is split into separate groups of one item. This may be done in several stages or all at once.
  3. BP2: the single items join into ordered pairs: 2 with 7, 1 with 3, 6 with 9 and 4 with 5.
  4. BP3: sorted groups of four are shown: 1 2 3 7 and 4 5 6 9.
  5. BP4: one finished list in ascending order, 1 to 7 and then 9, reached by a reasonable attempt at merging the two fours into an eight. That list shown with no merging steps, or made by another algorithm, earns nothing.
  6. Joining groups in the wrong order and sorting them afterwards does not earn BP3 or BP4.
  7. With no splitting shown at all, the starting list counts as already divided, so BP2 to BP4 can still be earned. A faulty split loses BP1 only.
  8. Using different numbers, or sorting into descending order, is penalised once and then followed through.

Why it scores

Merge sort first divides the list until every group holds one item. It then merges neighbouring groups, putting the numbers in order each time, until one sorted list remains.

Revise Merge Sort
03.2[3 marks]

Tick one box in each of the three tables, on insertion sort, bubble sort and arrays, to give correct statements.

See how you would score on Bubble Sort
Insertion sort: the array is split into a part already in order and a part still to doCorrect answer
Insertion sort: the first step is to pull out the middle item
Insertion sort: it joins separate arrays together
Bubble sort: after comparing two neighbours, it swaps them every time
Bubble sort: it swaps two neighbours only when they already sit the right way round
Bubble sort: it swaps two neighbours only when they sit the wrong way roundCorrect answer
Array: the number of items it holds is set when it is declaredCorrect answer
Array: it holds several values that the program cannot alter once stored
Array: it can have at most one dimension
Show model answer for 03.2Hide model answer for 03.2

Insertion sort: the array is split into a part already in order and a part still to do

Bubble sort: it swaps two neighbours only when they sit the wrong way round

Array: the number of items it holds is set when it is declared

3 marks

How the marks are earned

  1. One mark for each group, up to 3. A group with more than one box ticked earns nothing.
  2. Insertion sort: it uses an array with a sorted part and an unsorted part.
  3. Bubble sort: a pair is swapped only when the two values sit the wrong way round.
  4. Array: its length is fixed at the moment it is declared.

Why it scores

It takes each item from the unsorted part and inserts it in the right place in the sorted part. It does not start at the middle, and merging belongs to merge sort.

Swapping a pair that is already in order would undo the sort. Bubble sort only swaps a pair that is the wrong way round.

The size of an array is set when it is made. Its values can be changed while the program runs, and arrays can have more than one dimension.

Revise Bubble Sort
03.3[1 mark]

Give the name of the algorithm for searching that these steps describe.

See how you would score on Linear Search
Show model answer for 03.3Hide model answer for 03.3

Linear search

1 mark

How the marks are earned

  1. Linear search. The word linear on its own is credited. Linear sort is not.
Revise Linear Search
03.4[1 mark]

Identify one other condition that stops this search.

See how you would score on Linear Search
Show model answer for 03.4Hide model answer for 03.4

It stops when it reaches the end of the list, having checked every value without finding the target.

1 mark

How the marks are earned

  1. The end of the list has been reached, or the last value has been checked, or every value has been checked. Adding that the target was not found is not needed.
  2. A bare answer that the value is not found or not in the list earns nothing. The idea of reaching the end or checking the whole list must be there.
Revise Linear Search
OCR owns the copyright in its exam questions, so we cannot copy their wording. These descriptions and answers are ours. Not made or approved by OCR.[9 marks]