A botanist is recording the heights of five sunflower plants in centimetres. The recorded heights are: [165, 132, 110, 154, 143]
Complete the table to show the steps involved in applying the bubble sort algorithm to sort these heights into ascending order. You only need to show the state of the array after each individual swap is completed.
| 165 | 132 | 110 | 154 | 143 |
| 110 | 132 | 143 | 154 | 165 |
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.