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