guess the next step: Randomised quick sort
Before each step plays, guess what it does. The page then shows the step as the run takes it and says why, the same sentence the watch page says there.
Step 31 of 43
Question 19 of 25
Step 31 of 43
Step 32 of 43
Step 33 of 43
Step 34 of 43
Step 35 of 43
Step 37 of 43
Step 38 of 43
Step 39 of 43
Question 19 of 25
Question 19 of 25
Right.
You guessed: 49, the pivot, swaps to the end of the part.
What the run did:
Swap the pivot 49 to the end of the part, out of the way, and 31 goes where 49 was.
Question 19 of 25
Not this time.
You guessed: 49, the pivot, already stands at the end of the part.
What the run did:
Swap the pivot 49 to the end of the part, out of the way, and 31 goes where 49 was.
Question 20 of 25
Question 20 of 25
Not this time.
You guessed: 42 is smaller than the pivot 49, so it swaps onto the small side.
What the run did:
42 is smaller than the pivot 49, and it already stands at the end of the small side.
Question 20 of 25
Right.
You guessed: 42 is smaller than the pivot 49, and already stands at the end of the small side.
What the run did:
42 is smaller than the pivot 49, and it already stands at the end of the small side.
Question 20 of 25
Not this time.
You guessed: 42 is not smaller than the pivot 49, so it stays on the big side.
What the run did:
42 is smaller than the pivot 49, and it already stands at the end of the small side.
Question 21 of 25
Question 21 of 25
Not this time.
You guessed: 31 is smaller than the pivot 49, so it swaps onto the small side.
What the run did:
31 is smaller than the pivot 49, and it already stands at the end of the small side.
Question 21 of 25
Right.
You guessed: 31 is smaller than the pivot 49, and already stands at the end of the small side.
What the run did:
31 is smaller than the pivot 49, and it already stands at the end of the small side.
Question 21 of 25
Not this time.
You guessed: 31 is not smaller than the pivot 49, so it stays on the big side.
What the run did:
31 is smaller than the pivot 49, and it already stands at the end of the small side.
Question 22 of 25
Question 22 of 25
Not this time.
You guessed: The pivot swaps in just after the small side.
What the run did:
The pivot 49 already stands just after the small side, so it stays there for good.
Question 22 of 25
Right.
You guessed: The pivot already stands just after the small side.
What the run did:
The pivot 49 already stands just after the small side, so it stays there for good.
Question 23 of 25
Question 23 of 25
Not this time.
You guessed: 31, the pivot, swaps to the end of the part.
What the run did:
The pivot 31 already stands at the end of the part, out of the way.
Question 23 of 25
Right.
You guessed: 31, the pivot, already stands at the end of the part.
What the run did:
The pivot 31 already stands at the end of the part, out of the way.
Question 24 of 25
Question 24 of 25
Not this time.
You guessed: 42 is smaller than the pivot 31, so it swaps onto the small side.
What the run did:
42 is not smaller than the pivot 31, so it stays on the big side.
Question 24 of 25
Not this time.
You guessed: 42 is smaller than the pivot 31, and already stands at the end of the small side.
What the run did:
42 is not smaller than the pivot 31, so it stays on the big side.
Question 24 of 25
Right.
You guessed: 42 is not smaller than the pivot 31, so it stays on the big side.
What the run did:
42 is not smaller than the pivot 31, so it stays on the big side.