The pairing heap is a simple "self-adjusting" implementation of a heap (priority queue). Inserting an item into a pairing heap or decreasing the key of an item takes O(1) time worst-case, as does melding two heaps. But deleting an item of minimum key can take time linear in the heap size in the worst case. The paper that introduced the pairing heap proved an O(log n) amortized time bound for each heap operation, where n is the number of items in the heap or heaps involved in the operation, by charging all but O(log n) of the time for each deletion to non-deletion operations, O(log n) to each. Later Iacono found a way to reduce the amortized time per insertion to O(1) and that of meld to zero while preserving the O(log n) amortized time bound for the other update operations. We give a simpler proof of Iacono's result with significantly smaller constant factors. Our analysis uses the natural representation of pairing heaps instead of the conversion to a binary tree used in the original analysis and in Iacono's.
翻译:配对的堆积是一个简单的“ 自我调整” 的堆积( 优先队列) 。 将一个项目插入对齐堆或减少一个项目的键需要O(1) 时间最坏的情况, 和焊接两个堆一样。 但是, 在最坏的情况下, 删除一个最小键的项目会用堆积大小的时间线性时间。 引入配对堆的纸张证明了每个堆积的摊合时间为O( log n), 每一个堆积操作中, n 是指参与操作的堆积或堆积中的项目数量, 将每次删除的全部时间充电到非删除操作, O( log n) 最坏的情况需要O(1) 时间。 之后, Iacono 找到了一种方法, 将每次插入 O(1) 和 meld 的摊合时间缩短为零, 同时将 O( log n) 的摊合时间绑定到其它更新操作中。 我们用小得多的恒定因素简单地证明 Iacono 的结果。 我们的分析使用自然的配对齐结构, 而不是转换为原始分析中使用的双树 。