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