The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from bubble sort's own run on the numbers shown.
choose one
1question 1
Bubble sort makes its first walk along 8, 5, 1, 3, 7. What is the row when that walk ends?
the answer, and why
the answer is C
The walk compares 4 pairs and swaps 4 times, carrying the 8 to the end: 5, 1, 3, 7, 8.
if you chose another
AThat is the row sorted. One walk promises only that the biggest number reaches the end.
BThat stops after the first swap. A walk goes on to the end of its part.
DThat misses the last pair, 8 and 7, which the walk also swaps.