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 shell sort's own run on the numbers shown.
choose one
1question 1
Shell sort works on 9, 6, 3, 5, 1, 2, 8. What is the row after its first move?
the answer, and why
the answer is B
7 numbers take the gaps 4, 1. The gap 4 pass trades first where a number has a bigger one 4 places to its left, the 1 and the 9: 1, 6, 3, 5, 9, 2, 8.
if you chose another
AThat is insertion sort's first move, trading neighbours.
CThat trades numbers 3 places apart, the 9 and the 5.
DThat is the row after the whole gap 4 pass, not its first move.