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