arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.00688cs.DS

双选择线性探测的威力

The Power of Two-Choice Linear Probing

  • Northeastern University(东北大学)
  • Stony Brook University(石溪大学)
  • Carnegie Mellon University(卡内基梅隆大学)

机构由 AI 辅助整理,请以论文原文为准。

Amir Azarmehr, Michael A. Bender, William Kuszmaul, Rose Silver

AI总结:

本文研究双选择线性探测哈希表,证明贪心双选择策略优于单选择,且非贪心策略可实现期望查询时间 O(log ε^{-1}),允许驱逐时可达 O(1),揭示双选择现象的威力。

AI中文摘要:

本文考虑以下基本问题:如果一个(有序的)线性探测哈希表被允许使用两个哈希函数,而不是一个,那么这如何改变期望的插入和查询时间,作为负载因子 $1 - \epsilon$ 的函数?我们证明,贪心双选择插入策略比单选择算法实现了多项式更好的界限,但通过使用更复杂的非贪心策略,甚至可以做得更好。具体来说,我们展示了一种不驱逐元素的插入策略(一旦元素被插入,其哈希选择就固定),并且实现了期望查询时间 $O(\log \epsilon^{-1})$ 和期望插入时间 $O(\epsilon^{-1})$。然后我们进一步展示,如果允许驱逐元素(即,允许给定元素随时间改变其使用的哈希函数),那么可以实现期望查询时间 $O(1)$ 和期望插入时间 $O(\epsilon^{-1/2})$。这最终结果甚至在哈希表填满到 $100\\%$ 时也能实现期望查询时间 $O(1)$。综合来看,这些结果揭示了线性探测哈希表存在一个令人惊讶的强大的“双选择现象”,允许双选择哈希表实现比乍看之下可能认为的显著更好的界限。

英文摘要:

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 $1 - ε$? 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 $O(\log ε^{-1})$ with expected insertion time $O(ε^{-1})$. 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 $O(1)$ with expected insertion time $O(ε^{-1/2})$. This final result achieves an expected query time of $O(1)$ even when the hash table is filled to $100\%$ 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.

补充信息

↑