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.
| 3 | 5 | 2 | 1 | 4 |
| 1 | 2 | 3 | 4 | 5 |