Quadratic Probing Succeeds (for ? ? ½)
If size is prime and ? ? ½, then quadratic probing will find an empty slot in size/2 probes or fewer.
- show for all 0 ? i, j ? size/2 and i ? j
(h(x) + i2) mod size ? (h(x) + j2) mod size
- by contradiction: suppose that for some i, j:
(h(x) + i2) mod size = (h(x) + j2) mod size
i2 mod size = j2 mod size
(i2 - j2) mod size = 0
[(i + j)(i - j)] mod size = 0
- but how can i + j = 0 or i + j = size when
i ? j and i,j ? size/2?
- same for i - j mod size = 0