Quiz Entry - updated: 2026.12.01
Insert 12, 44, 13, 88, 23, 94, 11, 39, 20, 16, 5 into an 11-cell table with h(i) = (2i + 5) mod 11, double hashing and d(i) = 7 − i mod 7. What does the table look like?
Cells 0 to 10 hold 11, 23, 20, 16, 39, 44, 94, 12, 88, 13, 5.
| Key | h | d | Cells tried | Placed at |
|---|---|---|---|---|
| 12 | 7 | 7 | 7 | |
| 44 | 5 | 5 | 5 | |
| 13 | 9 | 9 | 9 | |
| 88 | 5 | 3 | 5, 8 | 8 |
| 23 | 7 | 5 | 7, 1 | 1 |
| 94 | 6 | 6 | 6 | |
| 11 | 5 | 3 | 5, 8, 0 | 0 |
| 39 | 6 | 3 | 6, 9, 1, 4 | 4 |
| 20 | 1 | 1 | 1, 2 | 2 |
| 16 | 4 | 5 | 4, 9, 3 | 3 |
| 5 | 4 | 2 | 4, 6, 8, 10 | 10 |
d is only needed after a collision. Steps wrap around mod 11: 23 goes 7 + 5 = 12 → 1, and 11 goes 5 → 8 → 11 → 0.
Because 11 is prime, every step from 1 to 10 eventually visits all cells, so even the last key finds the one free cell. It needs four probes here instead of eleven under linear probing.