guess the next step: Cocktail shaker 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 30 of 45
Question 19 of 30
Step 30 of 45
Step 31 of 45
Step 32 of 45
Step 33 of 45
Step 34 of 45
Step 35 of 45
Step 36 of 45
Step 37 of 45
Step 38 of 45
Question 19 of 30
Question 19 of 30
Right.
You guessed: 42 is bigger than 23, so they swap.
What the run did:
42 is bigger than 23, so they are the wrong way round.
Question 19 of 30
Not this time.
You guessed: 42 is not bigger than 23, so they stay.
What the run did:
42 is bigger than 23, so they are the wrong way round.
Question 20 of 30
Question 20 of 30
Not this time.
You guessed: 42 is bigger than 49, so they swap.
What the run did:
42 is not bigger than 49, so they stay as they are.
Question 20 of 30
Right.
You guessed: 42 is not bigger than 49, so they stay.
What the run did:
42 is not bigger than 49, so they stay as they are.
Question 21 of 30
Question 21 of 30
Right.
You guessed: The biggest number left settles at the right end.
What the run did:
49 is now at the right end of the unsorted part. Nothing bigger is left, so it stays there for good.
Question 21 of 30
Not this time.
You guessed: The smallest number left settles at the left end.
What the run did:
49 is now at the right end of the unsorted part. Nothing bigger is left, so it stays there for good.
Question 21 of 30
Not this time.
You guessed: Everything left is already in order.
What the run did:
49 is now at the right end of the unsorted part. Nothing bigger is left, so it stays there for good.
Question 22 of 30
Question 22 of 30
Not this time.
You guessed: 23 is bigger than 42, so they swap.
What the run did:
23 is not bigger than 42, so they stay as they are.
Question 22 of 30
Right.
You guessed: 23 is not bigger than 42, so they stay.
What the run did:
23 is not bigger than 42, so they stay as they are.
Question 23 of 30
Question 23 of 30
Right.
You guessed: 31 is bigger than 23, so they swap.
What the run did:
31 is bigger than 23, so they are the wrong way round.
Question 23 of 30
Not this time.
You guessed: 31 is not bigger than 23, so they stay.
What the run did:
31 is bigger than 23, so they are the wrong way round.
Question 24 of 30
Question 24 of 30
Not this time.
You guessed: 18 is bigger than 23, so they swap.
What the run did:
18 is not bigger than 23, so they stay as they are.
Question 24 of 30
Right.
You guessed: 18 is not bigger than 23, so they stay.
What the run did:
18 is not bigger than 23, so they stay as they are.