首页> 外文期刊>Algorithmica >On Sorting, Heaps, and Minimum Spanning Trees
【24h】

On Sorting, Heaps, and Minimum Spanning Trees

机译:关于排序树,堆树和最小生成树

获取原文
获取原文并翻译 | 示例
       

摘要

Let A be a set of size m. Obtaining the first k≤m elements of A in ascending order can be done in optimal O(m+klog k) time. We present Incremental Quicksort (IQS), an algorithm (online on k) which incrementally gives the next smallest element of the set, so that the first k elements are obtained in optimal expected time for any k. Based on IQS, we present the Quickheap (QH), a simple and efficient priority queue for main and secondary memory. Quickheaps are comparable with classical binary heaps in simplicity, yet are more cache-friendly. This makes them an excellent alternative for a secondary memory implementation. We show that the expected amortized CPU cost per operation over a Quickheap of m elements is O(log m), and this translates into O((1/B)log (m/M)) I/O cost with main memory size M and block size B, in a cache-oblivious fashion. As a direct application, we use our techniques to implement classical Minimum Spanning Tree (MST) algorithms. We use IQS to implement Kruskal’s MST algorithm and QHs to implement Prim’s. Experimental results show that IQS, QHs, external QHs, and our Kruskal’s and Prim’s MST variants are competitive, and in many cases better in practice than current state-of-the-art alternative (and much more sophisticated) implementations.
机译:设A为大小为m的集合。升序获取A的前k≤m个元素可以在最佳O(m + klog k)时间完成。我们提出了增量快速排序(IQS),这是一种算法(在k上在线),该算法递增地给出集合中的下一个最小元素,以便在任何k的最佳预期时间内获得前k个元素。基于IQS,我们介绍了Quickheap(QH),这是用于主存储器和辅助存储器的简单高效的优先级队列。 Quickheap在简单性上可与经典二进制堆相媲美,但对缓存更友好。这使它们成为辅助存储器实现的极佳替代方案。我们显示,在m个元素的Quickheap上,每次操作的预期摊销CPU成本为O(log m),这转换为主内存大小为M的O((1 / B)log(m / M))I / O成本和块大小B(以一种可忽略缓存的方式)。作为直接应用,我们使用我们的技术来实现经典的最小生成树(MST)算法。我们使用IQS来实现Kruskal的MST算法,并使用QH来实现Prim的算法。实验结果表明,IQS,QH,外部QH以及我们的Kruskal和Prim的MST变体具有竞争力,并且在许多情况下都比当前最新的替代(且更加复杂)的实现更好。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号