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 22, 17, 47, 12, 36, 18, and its first pick is the 36. What is the row just after the 36 is placed?
the answer, and why
the answer is C
The 36 swaps to the end: 22, 17, 47, 12, 18, 36. Each smaller number joins the small side at the front, then the 36 swaps in just after them: 22, 17, 12, 18, 36, 47.
if you chose another
AThat sorts both sides too, which waits for later splits.
BThat stops before the pivot swaps into place.
DThat is the row just after the pivot moves to the end.