Standard difficulty · 20 questions · 40 marks · Time: 43 minutes
Show your working for Sections B and C. Answers are on the last page — try every question first!
Sorting · AW-12CS-SRT-2026-V1 · For parents — fold back or tear off before handing the sheet to your child.
| Q | Answer | Working |
|---|---|---|
| 1 | (d) compares neighbouring items and swaps those out of order | — |
| 2 | (d) 39, 36, 27, 40, 58 | each pass compares neighbours left to right and swaps them when out of order; the largest left moves to the end |
| 3 | (a) 1, 29, 53, 58, 44 | each pass finds the smallest of the unsorted part and swaps it to the front of that part |
| 4 | (a) 25, 33, 48, 52, 41, 5 | pass i takes the item at index i and shifts the larger items on its left one place right |
| 5 | (d) 4 | compare each neighbouring pair once, left to right, swapping as you go |
| 6 | (b) 105 | 14 + 13 + … + 1 = 15 × 14 ÷ 2 |
| 7 | (a) [32, 36, 38, 58, 8, 28] | insertion sort for 3 passes |
| 8 | (c) bubble sort | bubble sort moves the largest to the end each pass |
| 9 | Sorted data is quicker to search and easier to read, e.g. words in a dictionary, marks ranked from highest, names in a register. | — |
| 10 | 8, 41, 45, 55, 57 | swaps in each pass: 3, 3 |
| 11 | 17, 26, 35, 31, 36, 46, 43 | each pass swaps the smallest of the unsorted part to its front |
| 12 | 33, 42, 52, 45, 31, 59, 26 | pass i inserts the item at index i into the sorted part on its left |
| 13 | 8 | swaps in each pass: 3, 3, 2, 0, 0 (each swap fixes one out-of-order pair) |
| 14 | [39, 42, 57, 30, 52] | insertion sort for 2 passes |
| 15 | 13, 17, 32, 30, 45, 59 | swap when the left item is larger |
| 16 | 8 | the shifts equal the number of out-of-order pairs; sorted: 3, 19, 21, 36, 43, 54 |
| 17 | def bubble(L): n = len(L); for i in range(n): for j in range(0, n − i − 1): if L[j] > L[j + 1]: L[j], L[j + 1] = L[j + 1], L[j]. Each pass compares neighbours and swaps those out of order; after pass i the i largest items are in place at the end. | — |
| 18 | (a) 52, 7, 29, 45, 46, 59 → 7, 29, 45, 46, 52, 59 → 7, 29, 45, 46, 52, 59 → 7, 29, 45, 46, 52, 59 → 7, 29, 45, 46, 52, 59; (b) 5, 4, 0, 0, 0; (c) pass 2 | the largest unsorted item reaches its place at the end of each pass |
| 19 | (a) 12, 29, 28, 54, 47, 31 → 12, 28, 29, 54, 47, 31 → 12, 28, 29, 54, 47, 31 → 12, 28, 29, 31, 47, 54 → 12, 28, 29, 31, 47, 54; (b) 12, 29, 28, 54, 47, 31 → 12, 28, 29, 54, 47, 31 → 12, 28, 29, 54, 47, 31 → 12, 28, 29, 47, 54, 31 → 12, 28, 29, 31, 47, 54 | selection: swap the smallest of the rest to the front; insertion: insert the next item into the sorted left part |
| 20 | (a) [18, 42, 32, 24, 58]; (b) bubble sort; (c) 3 | a list of 5 items needs at most 4 passes |