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