Also called Double hashing and Open addressing with a second hash.
fresh numbers
The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from hash table with double hashing's own run on the numbers shown.
choose one
1question 1
An empty table of 7 slots puts in 75, 96, 82, 89 and 68, all with home 5. How many probes do the five puts make in all?
the answer, and why
the answer is D
75 takes slot 5, 1 probe. Each of the others has its own step, 2, 3, 5, 4, and finds slot 5 taken, then a free slot. 1 + 2 + 2 + 2 + 2 is 9.
if you chose another
AThat walks one slot on each time, as linear probing does, 1 + 2 + 3 + 4 + 5.
BThat counts 1 probe a put, but each after 75 finds slot 5 taken.
CThat counts 2 probes for 75 too, but its home is free.
An empty table of 7 slots puts in 82 and 5, then 89. Which slot does 89 go in?
the answer, and why
the answer is B
82 takes slot 5. 5, home 5 and step 1, takes slot 6. 89 has home 5 and step 5. Slot 5 holds 82, and 5 + 5 is 10, which leaves 3 after dividing by 7. Slot 3 is free.
if you chose another
ASlot 6 already holds 5. 89's step is 5, so from slot 5 it moves to slot 3.
CSlot 5 is 89's home, but 82 already holds it.
DThat walks one slot on each time, 5, 6, 0, as linear probing does. 89's step is 5.