Skip to content

Course home

Sorting algorithms

Sorting algorithms

EasyMediumHard
123456789101112131415161718192021222324252627
Question 16

A technician at a logistics hub is using a sorting algorithm to arrange five cargo crates by weight. The initial unsorted weights (in tonnes) of the crates are recorded in the array [3,5,2,1,4][3, 5, 2, 1, 4][3,5,2,1,4].

Complete the table below to show the step-by-step state of the array when applying a bubble sort algorithm to sort these weights into ascending order.

You only need to write the state of the array after each individual swap (change) occurs.

35214
12345
[5]
Markscheme

Sorting algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Sorting algorithms

52 exam-style questions on AQA GCSE Computer Science Sorting algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank