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 22 of 45
Question 13 of 30
Step 22 of 45
Step 23 of 45
Step 24 of 45
Step 25 of 45
Step 26 of 45
Step 27 of 45
Step 28 of 45
Step 29 of 45
Step 30 of 45
Question 13 of 30
Question 13 of 30
Right.
You guessed: 31 is bigger than 12, so they swap.
What the run did:
31 is bigger than 12, so they are the wrong way round.
Question 13 of 30
Not this time.
You guessed: 31 is not bigger than 12, so they stay.
What the run did:
31 is bigger than 12, so they are the wrong way round.
Question 14 of 30
Question 14 of 30
Not this time.
You guessed: 7 is bigger than 12, so they swap.
What the run did:
7 is not bigger than 12, so they stay as they are.
Question 14 of 30
Right.
You guessed: 7 is not bigger than 12, so they stay.
What the run did:
7 is not bigger than 12, so they stay as they are.
Question 15 of 30
Question 15 of 30
Not this time.
You guessed: The biggest number left settles at the right end.
What the run did:
7 is now at the left end of the unsorted part. Nothing smaller is left, so it stays there for good.
Question 15 of 30
Right.
You guessed: The smallest number left settles at the left end.
What the run did:
7 is now at the left end of the unsorted part. Nothing smaller is left, so it stays there for good.
Question 15 of 30
Not this time.
You guessed: Everything left is already in order.
What the run did:
7 is now at the left end of the unsorted part. Nothing smaller is left, so it stays there for good.
Question 16 of 30
Question 16 of 30
Not this time.
You guessed: 12 is bigger than 31, so they swap.
What the run did:
12 is not bigger than 31, so they stay as they are.
Question 16 of 30
Right.
You guessed: 12 is not bigger than 31, so they stay.
What the run did:
12 is not bigger than 31, so they stay as they are.
Question 17 of 30
Question 17 of 30
Right.
You guessed: 31 is bigger than 18, so they swap.
What the run did:
31 is bigger than 18, so they are the wrong way round.
Question 17 of 30
Not this time.
You guessed: 31 is not bigger than 18, so they stay.
What the run did:
31 is bigger than 18, so they are the wrong way round.
Question 18 of 30
Question 18 of 30
Not this time.
You guessed: 31 is bigger than 42, so they swap.
What the run did:
31 is not bigger than 42, so they stay as they are.
Question 18 of 30
Right.
You guessed: 31 is not bigger than 42, so they stay.
What the run did:
31 is not bigger than 42, so they stay as they are.