Marcus uses a bubble sort algorithm to sort a list of daily low temperatures (in °C) into ascending order.
Complete the table to show the state of the list after each complete pass of the bubble sort algorithm.
You may not need to use all the rows.
| Pass | Element 1 | Element 2 | Element 3 | Element 4 | Element 5 | Element 6 |
|---|---|---|---|---|---|---|
| Initial | 7 | 3 | 8 | 2 | 9 | 5 |
| Pass 1 | ||||||
| Pass 2 | ||||||
| Pass 3 | ||||||
| Pass 4 | ||||||
| Pass 5 |
45 exam-style questions on Edexcel IGCSE Computer Science Algorithms. Each one has a worked solution and a mark scheme showing where the marks go.