首页> 外文会议>Workshop on Algorithm Engineering and Experiments >Worst-Case Efficient Sorting with QuickMergesort
【24h】

Worst-Case Efficient Sorting with QuickMergesort

机译:用QuickMergesort的最坏情况有效分类

获取原文

摘要

The two most prominent solutions for the sorting problem are Quicksort and Mergesort. While Quicksort is very fast on average, Mergesort additionally gives worst-case guarantees, but needs extra space for a linear number of elements. Worst-case efficient in-place sorting, however, remains a challenge: the standard solution, Heapsort, suffers from a bad cache behavior and is also not overly fast for in-cache instances. In this work we present median-of-medians QuickMergesort (MoMQuickMergesort), a new variant of QuickMergesort, which combines Quicksort with Mergesort allowing the latter to be implemented in place. Our new variant applies the median-of-medians algorithm for selecting pivots in order to circumvent the quadratic worst case. Indeed, we show that it uses at most n log n + 1.6n comparisons for n large enough. We experimentally confirm the theoretical estimates and show that the new algorithm outperforms Heapsort by far and is only around 10% slower than Introsort (std :: sort implementation of stdlibc++), which has a rather poor guarantee for the worst case. We also simulate the worst case, which is only around 10% slower than the average case. In particular, the new algorithm is a natural candidate to replace Heapsort as a worst-case stopper in Introsort.
机译:分拣问题的两个最突出的解决方案是Quicksorator和Mergeort。虽然Quicksort平均速度非常快,但默认提供了最坏情况的保证,但需要额外的空间用于线性数量的元素。然而,最糟糕的效率就地排序仍然是一个挑战:标准解决方案,大量遭受了糟糕的缓存行为,也没有速度过于缓存的实例。在这项工作中,我们呈现中位数QuickMergesort(Momquickmergesort),一种新的QuickMergesort的变种,它将Quicksort与合并允许后者实施的Quicksort。我们的新变种适用于中位数算法来选择枢轴,以规避二次最坏情况。实际上,我们表明它最多使用n log n + 1.6n比较n足够大。我们通过实验验证了理论估算,并表明新算法优于堆排序由远及比内省排序(的std ::排序实现stdlibc的++),这对于最坏的情况相当差的保证慢了10%左右。我们还模拟了最坏的情况,速度慢于平均水箱。特别是,新算法是替代海底作为Introsort中最坏情况塞子的自然候选者。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号