guess the next step: Quickselect
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 18 of 35
Question 13 of 25
Step 18 of 35
Step 19 of 35
Step 20 of 35
Step 21 of 35
Step 22 of 35
Step 23 of 35
Step 24 of 35
Step 25 of 35
Question 13 of 25
Question 13 of 25
Not this time.
You guessed: 18 is smaller than the pivot 12, so it swaps onto the small side.
What the run did:
18 is not smaller than the pivot 12, so it stays on the big side.
Question 13 of 25
Not this time.
You guessed: 18 is smaller than the pivot 12, and already stands at the end of the small side.
What the run did:
18 is not smaller than the pivot 12, so it stays on the big side.
Question 13 of 25
Right.
You guessed: 18 is not smaller than the pivot 12, so it stays on the big side.
What the run did:
18 is not smaller than the pivot 12, so it stays on the big side.
Question 14 of 25
Question 14 of 25
Not this time.
You guessed: 23 is smaller than the pivot 12, so it swaps onto the small side.
What the run did:
23 is not smaller than the pivot 12, so it stays on the big side.
Question 14 of 25
Not this time.
You guessed: 23 is smaller than the pivot 12, and already stands at the end of the small side.
What the run did:
23 is not smaller than the pivot 12, so it stays on the big side.
Question 14 of 25
Right.
You guessed: 23 is not smaller than the pivot 12, so it stays on the big side.
What the run did:
23 is not smaller than the pivot 12, so it stays on the big side.
Question 15 of 25
Question 15 of 25
Right.
You guessed: The pivot swaps in just after the small side.
What the run did:
Swap the pivot 12 in just after the small side, at place 2. That is where it would stand if the row were in order.
Question 15 of 25
Not this time.
You guessed: The pivot already stands just after the small side.
What the run did:
Swap the pivot 12 in just after the small side, at place 2. That is where it would stand if the row were in order.
Question 16 of 25
Question 16 of 25
Not this time.
You guessed: The pivot 12 stands at place 4, so it is the number wanted.
What the run did:
Place 4 lies to the right of place 2, so rule out the pivot 12 and every number to its left.
Question 16 of 25
Not this time.
You guessed: Place 4 lies to the left of the pivot 12, so keep the left part.
What the run did:
Place 4 lies to the right of place 2, so rule out the pivot 12 and every number to its left.
Question 16 of 25
Right.
You guessed: Place 4 lies to the right of the pivot 12, so keep the right part.
What the run did:
Place 4 lies to the right of place 2, so rule out the pivot 12 and every number to its left.
Question 17 of 25
Question 17 of 25
Not this time.
You guessed: 31 is smaller than the pivot 42, so it swaps onto the small side.
What the run did:
31 is smaller than the pivot 42, and it already stands at the end of the small side.
Question 17 of 25
Right.
You guessed: 31 is smaller than the pivot 42, and already stands at the end of the small side.
What the run did:
31 is smaller than the pivot 42, and it already stands at the end of the small side.
Question 17 of 25
Not this time.
You guessed: 31 is not smaller than the pivot 42, so it stays on the big side.
What the run did:
31 is smaller than the pivot 42, and it already stands at the end of the small side.
Question 18 of 25
Question 18 of 25
Not this time.
You guessed: 18 is smaller than the pivot 42, so it swaps onto the small side.
What the run did:
18 is smaller than the pivot 42, and it already stands at the end of the small side.
Question 18 of 25
Right.
You guessed: 18 is smaller than the pivot 42, and already stands at the end of the small side.
What the run did:
18 is smaller than the pivot 42, and it already stands at the end of the small side.
Question 18 of 25
Not this time.
You guessed: 18 is not smaller than the pivot 42, so it stays on the big side.
What the run did:
18 is smaller than the pivot 42, and it already stands at the end of the small side.