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