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