虚拟内存Powersort
Virtual-Memory Powersort
AI总结:
提出一种自适应归并排序的改进版本——虚拟内存Powersort,通过内部缓冲技术将内存消耗从n/2个对象降至O(√(n log n))个对象,同时保持与原始Powersort几乎相同的移动和比较次数,实验表明在多数场景下可实现几乎原地稳定排序且开销可忽略。
摘要:
我们给出了一种更节省空间的自适应归并排序实现:虚拟内存Powersort。利用内部缓冲技术,我们显著降低了算法的内存消耗;具体而言,对于排序n个对象,所需的缓冲区空间从n/2个对象减少到O(√(n log n))个对象。虽然这种空间效率在概念上可以通过已知的就地归并算法轻松实现(甚至可降至O(1)),但将这些算法作为标准归并算法的直接替代会导致显著的性能下降。相比之下,虚拟内存Powersort使用的移动和比较次数与之前的Powersort实现相同,仅增加O(n)项。我们报告了一项实证运行时间研究,将我们的实现与其他Powersort变体以及最先进的稳定排序方法进行比较,证明在多数场景下,几乎原地稳定排序可以以可忽略的开销实现。
英文摘要:
We give a more space-efficient implementation of adaptive mergesort: Virtual-Memory Powersort. Using internal buffering techniques, we significantly reduce the memory consumption of the algorithm; specifically, for sorting $n$ objects the required buffer area is reduced from space for $n/2$ objects to $O(\sqrt{n \log n})$ objects. While this space-efficiency can be achieved (indeed reduced to $O(1)$) conceptually very easily with known inplace merging algorithms, using these as a drop-in replacement for the standard merge algorithm incurs a substantial slow-down. Virtual-Memory Powersort, by contrast, uses the same number of moves and comparisons as previous Powersort implementations up to an additive $O(n)$ term. We report on an empirical running-time study comparing our implementation against other Powersort variants and state-of-the-art stable sorting methods, demonstrating that almost in-place stable sorting can be achieved with negligible overhead in many scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。