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

非贪婪插入的线性探测

Linear Probing with Non-Greedy Insertions

Andrew Krapivin, William Kuszmaul, Yixuan Wang

首次发表
浏览论文内容

中文总结 AI 辅助

研究线性探测哈希表插入策略,提出非贪婪插入策略,相比传统贪婪策略,在给定x时,能将最坏情况预期插入时间从Θ(x²)降至O(x log x) 。

中文摘要 AI 辅助

线性探测哈希表传统上使用“贪婪”插入策略,将键u放置在h(u)、h(u)+1、h(u)+2等首个可用位置。当哈希表填充到1 - 1/x满时,这会导致最坏情况预期插入时间为Θ(x²)。本文展示一种简单的“非贪婪”插入策略效果更好,且无需随时间在表内重新排序元素。给定x,该策略能将最坏情况预期插入时间降至O(x log x)。

英文摘要

Linear probing hash tables classically use a \emph{greedy} insertion strategy, placing a key $u$ in the first available position out of $h(u), h(u) + 1, h(u) + 2, \ldots$. If the hash table is filled to $1 - 1/x$ full, this results in $Θ(x^{2})$ worst-case expected insertion time. In this paper, we introduce interlinear probing, a simple \emph{non-greedy} insertion strategy that does better without requiring elements to be reordered within the table over time. Given $x$ in advance, the algorithm brings the worst-case expected insertion time (and therefore also the worst-case expected positive query time) down to $O(x \log x)$. We also extend the algorithm to support \emph{negative} queries in worst-case expected time $O(x (\log x)^2)$. Moreover, our construction achieves $O(x)$ amortized insertion time, matching that of standard linear probing. Finally, we prove a lower bound showing that any stable insertion strategy for linear probing must incur $Ω(x \sqrt{\log x})$ worst-case expected time. Combined, our results establish that the optimal worst-case expected insertion time among stable insertion strategies is $x (\log x)^{Θ(1)}$.

发表机构

  • Carnegie Mellon University(卡内基梅隆大学)

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

↑