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