AQA GCSE Computer Science June 2025 Paper 1, Question 6: bubble sort against merge sort

AQA 8525 June 2025 Paper 1, Question 6: show every swap of a bubble sort on 45, 23, 78, 55, 49, show the merge stage of a merge sort on the same five numbers, compare the two sorts, and explain why binary search suits 2500 sorted values. With both sorts to run.

Past paper questionAQA 8525/1BJune 2025 Paper 110 marksExplain

Question 6 of the AQA GCSE Computer Science Paper 1 sat on 12 May 2025 (8525/1B, the Python paper) is 10 marks on the standard algorithms, with no code to write. You show a bubble sort (3 marks), show the merging stage of a merge sort (3 marks), compare the two (2 marks) and justify a binary search (2 marks).

We do not copy the exam paper here. Open it beside this page: AQA June 2025 Paper 1B question paper (PDF). When you have finished, check the mark scheme too.

Part 1: the bubble sort

The numbers are 45, 23, 78, 55, 49. The table gives you the first row and the last row, with three blank rows between. The instruction to notice: show the new order every time the order has changed. So each swap gets a row.

Compare neighbours from the left, and swap when the left one is bigger.

Step List What happened
start 45, 23, 78, 55, 49
1 23, 45, 78, 55, 49 45 and 23 swapped
2 23, 45, 55, 78, 49 45 and 78 stayed. 78 and 55 swapped
3 23, 45, 55, 49, 78 78 and 49 swapped. End of pass 1
4 23, 45, 49, 55, 78 pass 2: 55 and 49 swapped

Rows 1, 2 and 3 are the three answers. One mark each, in order. If you show whole passes and not single swaps, you get 1 mark.

Part 2: the merge stage

The five numbers start as five single boxes and the sorted list is at the bottom. You draw the merging in between. With an odd number of items, one is left on its own for a round.

  • Merge into pairs: [23, 45] and [55, 78], with [49] on its own.
  • Merge again: [23, 45, 55, 78], with [49] still on its own. (Or merge [55, 78] with [49] first, to make [49, 55, 78]. Either is accepted.)
  • Final merge: [23, 45, 49, 55, 78].

The three marks: sorted pairs; one item correctly left alone; a sorted group of three or four.

Part 3: bubble sort compared with merge sort

  • Advantage of a bubble sort: it is simpler to code. (Also accepted: it can be quicker on a very small list, and it uses less memory.)
  • Disadvantage: it is slower on large lists. It is less efficient.

"Bubble sort is simple" is not enough. Simple to what? Say simpler to code.

Part 4: why a binary search for 2500 sorted values?

  • A binary search is more efficient: it takes less time on average...
  • ...because it halves the number of values left with each comparison, so far fewer comparisons are needed. For 2500 values that is at most 12. A linear search might have to check all 2500.

The array is already in order, so the binary search's one requirement is met.

Where the marks are lost

  • Showing passes, not swaps, in part 1. Read the instruction above the table.
  • Swapping when no swap is needed. 45 and 78 are in order. That comparison changes nothing, and gets no row.
  • Splitting in part 2. The boxes at the top are already split. The question asks for the merge part only.
  • "Faster" with no reason in part 4. The second mark is for why: it halves the list each time.

Run it

A bubble sort that prints the list after every swap, which is exactly the table in part 1. Then a merge of the two halves from part 2.

The bubble sort prints four swaps: the three answers to part 1, then the last swap that finishes the job. Then it merges [23, 45, 55, 78] with [49].
The program
from bugbot import *
connect()

numbers = [45, 23, 78, 55, 49]
print(numbers)
swapped = True
while swapped:
    swapped = False
    for i in range(len(numbers) - 1):
        if numbers[i] > numbers[i + 1]:
            temp = numbers[i]
            numbers[i] = numbers[i + 1]
            numbers[i + 1] = temp
            swapped = True
            print(numbers)

def merge(left, right):
    result = []
    while len(left) > 0 and len(right) > 0:
        if left[0] <= right[0]:
            result.append(left.pop(0))
        else:
            result.append(right.pop(0))
    return result + left + right

print("merge:", merge([23, 45, 55, 78], [49]))
Put this demo on your own site

Paste it into a school website, Moodle, Google Sites or a blog. More options on the embed page.

Questions

What is the answer to AQA GCSE Computer Science 2025 Paper 1 Question 6.1?

The three missing rows are 23 45 78 55 49, then 23 45 55 78 49, then 23 45 55 49 78.

What is an advantage of a bubble sort over a merge sort?

It is simpler to write, and it needs very little extra memory. Its disadvantage is that it is much slower on large lists.

How many comparisons does a binary search need for 2500 items?

At most 12, because halving 2500 twelve times gets down to a single item. A linear search could need 2500.

More from this paper

Every AQA 8525 question we have worked · Guide: Big O notation explained

Learn it step by step

  1. F5.7 Bubble sort Algorithms
  2. F5.9 Merge sort and comparing algorithms Algorithms
  3. F5.6 Binary search Algorithms
Open the lessons

This is our own explanation of a published exam question. It is not written or endorsed by AQA, and the question paper and mark scheme remain AQA's copyright. Read them on AQA's site with the links on this page.