English

Linear Probing with Non-Greedy Insertions

Data Structures and Algorithms 2026-07-20 v1

Abstract

Linear probing hash tables classically use a \emph{greedy} insertion strategy, placing a key uu in the first available position out of h(u),h(u)+1,h(u)+2,h(u), h(u) + 1, h(u) + 2, \ldots. If the hash table is filled to 11/x1 - 1/x full, this results in Θ(x2)\Theta(x^{2}) worst-case expected insertion time. In this note, we show that there is a simple \emph{non-greedy} insertion strategy that does better, and without requiring elements to be reordered within the table over time. Given xx in advance, the strategy is able to bring the worst-case expected insertion time down to O(xlogx)O(x \log x).

Cite

@article{arxiv.2607.17494,
  title  = {Linear Probing with Non-Greedy Insertions},
  author = {Andrew Krapivin and William Kuszmaul and Jolyne Wang},
  journal= {arXiv preprint arXiv:2607.17494},
  year   = {2026}
}