guess the next step: Hash table that grows
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 92
Question 7 of 75
Step 8 of 92
Step 9 of 92
Step 10 of 92
Step 11 of 92
Step 12 of 92
Step 13 of 92
Step 14 of 92
Step 15 of 92
Step 16 of 92
Question 7 of 75
Question 7 of 75
Not this time.
You guessed: With 17, no more than half the slots would hold a number, so they stay.
What the run did:
With 17, 2 of the 2 slots would hold a number, more than half. Double them to 4, and take the number out to move.
Question 7 of 75
Right.
You guessed: With 17, more than half the slots would hold a number, so double them.
What the run did:
With 17, 2 of the 2 slots would hold a number, more than half. Double them to 4, and take the number out to move.
Question 8 of 75
Question 8 of 75
Right.
You guessed: The new home of 1 is slot 1.
What the run did:
Move 1: it leaves 1 when divided by 4, so its new home is slot 1.
Question 8 of 75
Not this time.
You guessed: The new home of 1 is slot 2.
What the run did:
Move 1: it leaves 1 when divided by 4, so its new home is slot 1.
Question 8 of 75
Not this time.
You guessed: The new home of 1 is slot 3.
What the run did:
Move 1: it leaves 1 when divided by 4, so its new home is slot 1.
Question 9 of 75
Question 9 of 75
Right.
You guessed: The home of 17 among the new slots is slot 1.
What the run did:
Now 17 leaves 1 when divided by 4, so its home among the new slots is slot 1.
Question 9 of 75
Not this time.
You guessed: The home of 17 among the new slots is slot 2.
What the run did:
Now 17 leaves 1 when divided by 4, so its home among the new slots is slot 1.
Question 9 of 75
Not this time.
You guessed: The home of 17 among the new slots is slot 3.
What the run did:
Now 17 leaves 1 when divided by 4, so its home among the new slots is slot 1.
Question 10 of 75
Question 10 of 75
Not this time.
You guessed: Slot 1 is empty, so 17 is not in the table yet.
What the run did:
Slot 1 holds 1, so look at the next slot for 17.
Question 10 of 75
Right.
You guessed: Slot 1 holds another number, so look at the next.
What the run did:
Slot 1 holds 1, so look at the next slot for 17.
Question 10 of 75
Not this time.
You guessed: Slot 1 already holds 17, so turn it away.
What the run did:
Slot 1 holds 1, so look at the next slot for 17.
Question 11 of 75
Question 11 of 75
Right.
You guessed: The home of 33 is slot 1.
What the run did:
33 leaves 1 when divided by 4, so its home is slot 1.
Question 11 of 75
Not this time.
You guessed: The home of 33 is slot 2.
What the run did:
33 leaves 1 when divided by 4, so its home is slot 1.
Question 11 of 75
Not this time.
You guessed: The home of 33 is slot 3.
What the run did:
33 leaves 1 when divided by 4, so its home is slot 1.
Question 12 of 75
Question 12 of 75
Not this time.
You guessed: Slot 1 is empty, so 33 is not in the table yet.
What the run did:
Slot 1 holds 1, so look at the next slot for 33.
Question 12 of 75
Right.
You guessed: Slot 1 holds another number, so look at the next.
What the run did:
Slot 1 holds 1, so look at the next slot for 33.
Question 12 of 75
Not this time.
You guessed: Slot 1 already holds 33, so turn it away.
What the run did:
Slot 1 holds 1, so look at the next slot for 33.