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