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 2 of 59
Question 1 of 42
Step 2 of 59
Step 3 of 59
Step 4 of 59
Step 5 of 59
Step 6 of 59
Step 7 of 59
Step 8 of 59
Question 1 of 42
Question 1 of 42
Right.
You guessed: 56, the pivot, swaps to the end of the part.
What the run did:
Swap the pivot 56 to the end of the part, out of the way, and 18 goes where 56 was.
Question 1 of 42
Not this time.
You guessed: 56, the pivot, already stands at the end of the part.
What the run did:
Swap the pivot 56 to the end of the part, out of the way, and 18 goes where 56 was.
Question 2 of 42
Question 2 of 42
Not this time.
You guessed: 12 is smaller than the pivot 56, so it swaps onto the small side.
What the run did:
12 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 2 of 42
Right.
You guessed: 12 is smaller than the pivot 56, and already stands at the end of the small side.
What the run did:
12 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 2 of 42
Not this time.
You guessed: 12 is not smaller than the pivot 56, so it stays on the big side.
What the run did:
12 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 3 of 42
Question 3 of 42
Not this time.
You guessed: 42 is smaller than the pivot 56, so it swaps onto the small side.
What the run did:
42 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 3 of 42
Right.
You guessed: 42 is smaller than the pivot 56, and already stands at the end of the small side.
What the run did:
42 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 3 of 42
Not this time.
You guessed: 42 is not smaller than the pivot 56, so it stays on the big side.
What the run did:
42 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 4 of 42
Question 4 of 42
Not this time.
You guessed: 49 is smaller than the pivot 56, so it swaps onto the small side.
What the run did:
49 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 4 of 42
Right.
You guessed: 49 is smaller than the pivot 56, and already stands at the end of the small side.
What the run did:
49 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 4 of 42
Not this time.
You guessed: 49 is not smaller than the pivot 56, so it stays on the big side.
What the run did:
49 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 5 of 42
Question 5 of 42
Not this time.
You guessed: 31 is smaller than the pivot 56, so it swaps onto the small side.
What the run did:
31 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 5 of 42
Right.
You guessed: 31 is smaller than the pivot 56, and already stands at the end of the small side.
What the run did:
31 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 5 of 42
Not this time.
You guessed: 31 is not smaller than the pivot 56, so it stays on the big side.
What the run did:
31 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 6 of 42
Question 6 of 42
Not this time.
You guessed: 7 is smaller than the pivot 56, so it swaps onto the small side.
What the run did:
7 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 6 of 42
Right.
You guessed: 7 is smaller than the pivot 56, and already stands at the end of the small side.
What the run did:
7 is smaller than the pivot 56, and it already stands at the end of the small side.
Question 6 of 42
Not this time.
You guessed: 7 is not smaller than the pivot 56, so it stays on the big side.
What the run did:
7 is smaller than the pivot 56, and it already stands at the end of the small side.