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 randomised quick sort's own run on the numbers shown.
choose one
1question 1
Randomised quick sort works on 19, 42, 33, 11, 25, 48, and its first pick is the 33. What is the row just after the 33 is placed?
the answer, and why
the answer is D
The 33 swaps to the end: 19, 42, 48, 11, 25, 33. The 19 is smaller and stays. The 11 swaps with the 42: 19, 11, 48, 42, 25, 33. The 25 swaps with the 48: 19, 11, 25, 42, 48, 33. Then the 33 swaps with the 42 just after them.
if you chose another
AThat sorts both sides too, which waits for later splits.
BThat stops before the pivot swaps into place.
CThat is the row just after the pivot moves to the end.