...
首页> 外文期刊>ACM transactions on algorithms >Optimal Partitioning for Dual-Pivot Quicksort
【24h】

Optimal Partitioning for Dual-Pivot Quicksort

机译:双轴Quicksort的最佳分区

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

摘要

Dual-pivot quicksort refers to variants of classical quicksort where in the partitioning step two pivots are used to split the input into three segments. This can be done in different ways, giving rise to different algorithms. Recently, a dual-pivot algorithm due to Yaroslavskiy received much attention, because it replaced the well-engineered quicksort algorithm in Oracle's Java 7 runtime library. Nebel and Wild (ESA 2012) analyzed this algorithm and showed that on average it uses 1.9n ln n + O(n) comparisons to sort an input of size n, beating standard quicksort, which uses 2n ln n+ O(n) comparisons. We introduce a model that captures all dual-pivot algorithms, give a unified analysis, and identify new dual-pivot algorithms that minimize the average number of key comparisons among all possible algorithms up to a linear term. This minimum is 1.8n ln n + O(n). For the case that the pivots are chosen from a small sample, we include a comparison of dual-pivot quicksort and classical quicksort. Specifically, we show that dual-pivot quicksort benefits from a skewed choice of pivots. We experimentally evaluate our algorithms and compare them to Yaroslavskiy's algorithm and the recently described 3-pivot quicksort algorithm of Kushagra et al. (ALENEX 2014).
机译:Dual-pivot快速排序是指经典快速排序的变体,其中在分区步骤中,使用两个枢轴将输入分为三个部分。这可以用不同的方式完成,从而产生不同的算法。最近,由于Yaroslavskiy引起的双轴算法受到了广泛关注,因为它替代了Oracle Java 7运行时库中精心设计的quicksort算法。 Nebel和Wild(ESA 2012)分析了该算法,结果表明,平均而言,它使用1.9n ln n + O(n)比较来对大小为n的输入进行排序,超过了使用2n ln n + O(n)比较的标准快速排序。我们引入了一个模型,该模型可以捕获所有双枢轴算法,进行统一分析,并确定新的双枢轴算法,从而最大程度地减少线性算法中所有可能算法的键比较的平均次数。最小值为1.8n ln n + O(n)。对于从小样本中选择枢轴的情况,我们将双枢轴快速排序与经典快速排序进行了比较。具体来说,我们证明了双轴快速排序受益于轴的偏斜选择。我们通过实验评估我们的算法,并将其与Yaroslavskiy算法以及最近描述的Kushagra等人的3点快速排序算法进行比较。 (ALENEX 2014)。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号