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