arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1407.3377cs.DS
收藏

强化的惰性堆:超越二进制堆的下界

Strengthened Lazy Heaps: Surpassing the Lower Bounds for Binary Heaps

Stefan Edelkamp, Jyrki Katajainen, Amr Elmasry

摘要:

令$n$表示当前在数据结构中的元素的数目。就地堆存储在数组的第一个$n$位置,使用$O(1)$额外的空间,并支持操作:最小值,插入和提取min。我们介绍了一个就地堆,其中最小值和插入需要$O(1)$最坏情况的时间,提取min需要$O(\lg{} n)$最坏情况的时间,并涉及最多$\lg{} n + O(1)$元素比较。所实现的界限是最佳的内添加剂常数项的元素比较的数量。特别是,insert和extract-min的这些界限以及insert的时间界限超过了二进制堆的相应下限,尽管我们的数据结构是类似的。在一个二叉堆中,当被看作一个几乎完全的二叉树时,除了根节点之外的每个节点都服从堆的性质,即节点上的元素不小于其父节点上的元素。为了超过extract-min的下限,我们在堆的底层加强了一个更强的属性,即任何右子元素的元素都不小于其左兄弟元素的元素。为了超过插入的下限,我们缓冲插入,并允许$O(\lg^2{} n)$节点违反与其父节点相关的堆顺序。

英文摘要:

Let $n$ denote the number of elements currently in a data structure. An in-place heap is stored in the first $n$ locations of an array, uses $O(1)$ extra space, and supports the operations: minimum, insert, and extract-min. We introduce an in-place heap, for which minimum and insert take $O(1)$ worst-case time, and extract-min takes $O(\lg{} n)$ worst-case time and involves at most $\lg{} n + O(1)$ element comparisons. The achieved bounds are optimal to within additive constant terms for the number of element comparisons. In particular, these bounds for both insert and extract-min -and the time bound for insert- surpass the corresponding lower bounds known for binary heaps, though our data structure is similar. In a binary heap, when viewed as a nearly complete binary tree, every node other than the root obeys the heap property, i.e. the element at a node is not smaller than that at its parent. To surpass the lower bound for extract-min, we reinforce a stronger property at the bottom levels of the heap that the element at any right child is not smaller than that at its left sibling. To surpass the lower bound for insert, we buffer insertions and allow $O(\lg^2{} n)$ nodes to violate heap order in relation to their parents.

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

↑