The Power of Two-Choice Linear Probing
Amir Azarmehr, Michael A. Bender, William Kuszmaul, Rose Silver
Abstract
This paper considers the following basic question: If an (ordered) linear-probing hash table is allowed \emph{two} hash functions, instead of one, how does this change the expected insertion and query time, as a function of the load factor ? We prove that the \emph{greedy two-choice insertion strategy} achieves polynomially better bounds than the single choice algorithm, but that one can even do \emph{much better} by using more sophisticated non-greedy strategies. Specifically, we show that there is an insertion strategy that does not evict elements (once an element is inserted, its hash choice is fixed) and that achieves expected query time with expected insertion time . We then further show that, if one is allowed to evict elements (i.e., to change over time which hash function a given element uses), then it is possible to achieve expected query time with expected insertion time . This final result achieves an expected query time of even when the hash table is filled to full. Combined, the results reveal that there is a surprisingly strong ``power of two choices'' phenomenon for linear-probing hash tables, allowing for a two-choice hash table to achieve significantly better bounds than what might at first seem to be possible.
Create a lesson
Metadata
- Journal
- FOCS 2026
Related papers
Graph Minor Decomposition in Almost-Linear Time
Shared title terminologycs.DSMohammadTaghi Hajiaghayi, Mahdi JafariRaviz
Above the Critical Load: Maximizing Factual Recall in a Saturated Linear Associative Memory
Shared title terminologycs.DSHanGyeol Lee, Ananda Phan Iman, Chang Wook Ahn
Approximately Counting Knapsack Solutions in Almost Linear Time
Shared title terminologycs.DSLin Chen, Biyou Ma, Yuchen Mao et al.
Near-Linear Almost Exact Diameter in Weighted Planar Digraphs
Shared title terminologycs.DSShinwoo An, Avi Kadria, Wolfgang Mulzer et al.
A Tight 2-Approximation for Min-Power Edge Multicover
Shared title terminologycs.DSAmir Belgi, Zeev Nutov
Near-Linear Time Maximum Weight Clique for Objects Inscribed in a Circle
Shared title terminologycs.DSJaehyun Koo, Dario Moschetti