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