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