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

展开前序和后序

Splaying Preorders and Postorders

Caleb C. Levy, Robert E. Tarjan

摘要:

假设$T$是二叉查找树。我们证明了两个结果的行为的Splay算法(Sleator和Tarjan 1985)。我们的第一个结果是,通过按照$T$的前序或$T$的后序的顺序展开,将键插入到空的二叉搜索树中需要线性时间。我们的证明使用了前序和后序是模式回避的事实:即它们不包含分别与$(2,3,1)$和$(3,1,2)$序同构的序。模式避免意味着对插入项目的方式的某些约束。我们利用这个结构与一个简单的潜在的功能,计数插入的节点躺在访问路径未插入的节点。我们的方法可以扩展到避免更一般模式的排列。其次,如果$T'$是与$T$具有相同键的任何其他二叉查找树,并且$T$是权重平衡的(Nievergelt and Reingold 1973),则从$T'$开始展开$T$的前序序列或$T$的后序序列需要线性时间。为了证明这一点,我们证明了平衡搜索树的前序和后序在对称顺序中不包含许多大的“跳跃”,并利用动态指定理(Cole et al. 2000)来利用这一事实。我们的两个结果都为难以捉摸的“动态最优性猜想”提供了进一步的证据。"

英文摘要:

Let $T$ be a binary search tree. We prove two results about the behavior of the Splay algorithm (Sleator and Tarjan 1985). Our first result is that inserting keys into an empty binary search tree via splaying in the order of either $T$'s preorder or $T$'s postorder takes linear time. Our proof uses the fact that preorders and postorders are pattern-avoiding: i.e. they contain no subsequences that are order-isomorphic to $(2,3,1)$ and $(3,1,2)$, respectively. Pattern-avoidance implies certain constraints on the manner in which items are inserted. We exploit this structure with a simple potential function that counts inserted nodes lying on access paths to uninserted nodes. Our methods can likely be extended to permutations that avoid more general patterns. Second, if $T'$ is any other binary search tree with the same keys as $T$ and $T$ is weight-balanced (Nievergelt and Reingold 1973), then splaying $T$'s preorder sequence or $T$'s postorder sequence starting from $T'$ takes linear time. To prove this, we demonstrate that preorders and postorders of balanced search trees do not contain many large "jumps" in symmetric order, and exploit this fact by using the dynamic finger theorem (Cole et al. 2000). Both of our results provide further evidence in favor of the elusive "dynamic optimality conjecture."

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑