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 98, 42, 70, 49 and 21, all with home 0. How many probes do the five puts make in all?
the answer, and why
the answer is B
98 takes slot 0, 1 probe. Each of the others has its own step, 3, 1, 5, 2, and finds slot 0 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.
CThat counts 1 probe a put, but each after 98 finds slot 0 taken.
DThat counts 2 probes for 98 too, but its home is free.
An empty table of 7 slots puts in 76 and 55, then 83. Which slot does 83 go in?
the answer, and why
the answer is B
76 takes slot 6. 55, home 6 and step 1, takes slot 0. 83 has home 6 and step 4. Slot 6 holds 76, and 6 + 4 is 10, which leaves 3 after dividing by 7. Slot 3 is free.
if you chose another
ASlot 0 already holds 55. 83's step is 4, so from slot 6 it moves to slot 3.
CSlot 6 is 83's home, but 76 already holds it.
DThat walks one slot on each time, 6, 0, 1, as linear probing does. 83's step is 4.