CAPE Computer Science Unit 2 · 2013 · Paper 2 · Question 2(a)(iv)a)
Given a C function `bubbleSort(int a[], int numItems)` implementing bubble sort on an array of integers.
Given the array a with 5 values: [5, 1, 4, 8, 2], show the contents of the array after each stage during the FIRST pass of the bubble sort.
This question uses a figure or table from the paper — you'll see it when you practise.
The mark scheme is shown once you've answered.
Practise this question