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 3, 24, 31, 17 and 10, all with home 3. How many probes do the five puts make in all?
the answer, and why
the answer is D
3 takes slot 3, 1 probe. Each of the others has its own step, 5, 2, 3, 1, and finds slot 3 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 3 finds slot 3 taken.
CThat counts 2 probes for 3 too, but its home is free.
An empty table of 7 slots puts in 71 and 85, then 57. Which slot does 57 go in?
the answer, and why
the answer is A
71 takes slot 1. 85, home 1 and step 1, takes slot 2. 57 has home 1 and step 3. Slot 1 holds 71, and 1 + 3 is 4, which leaves 4 after dividing by 7. Slot 4 is free.
if you chose another
BSlot 2 already holds 85. 57's step is 3, so from slot 1 it moves to slot 4.
CSlot 1 is 57's home, but 71 already holds it.
DThat walks one slot on each time, 1, 2, 3, as linear probing does. 57's step is 3.