首页> 外文期刊>Algorithmica >Analysis of Pivot Sampling in Dual-Pivot Quicksort: A Holistic Analysis of Yaroslavskiy's Partitioning Scheme
【24h】

Analysis of Pivot Sampling in Dual-Pivot Quicksort: A Holistic Analysis of Yaroslavskiy's Partitioning Scheme

机译:双轴快速排序中的轴采样分析:Yaroslavskiy分区方案的整体分析

获取原文
           

摘要

The new dual-pivot Quicksort by Vladimir Yaroslavskiy-used in Oracle's Java runtime library since version 7-features intriguing asymmetries. They make a basic variant of this algorithm use less comparisons than classic single-pivot Quicksort. In this paper, we extend the analysis to the case where the two pivots are chosen as fixed order statistics of a random sample. Surprisingly, dual-pivot Quicksort then needs more comparisons than a corresponding version of classic Quicksort, so it is clear that counting comparisons is not sufficient to explain the running time advantages observed for Yaroslavskiy's algorithm in practice. Consequently, we take a more holistic approach and give also the precise leading term of the average number of swaps, the number of executed Java Bytecode instructions and the number of scanned elements, a new simple cost measure that approximates I/O costs in the memory hierarchy. We determine optimal order statistics for each of the cost measures. It turns out that the asymmetries in Yaroslavskiy's algorithm render pivots with a systematic skew more efficient than the symmetric choice. Moreover, we finally have a convincing explanation for the success of Yaroslavskiy's algorithm in practice: compared with corresponding versions of classic single-pivot Quicksort, dual-pivot Quicksort needs significantly less I/Os, both with and without pivot sampling.
机译:弗拉基米尔·雅罗斯拉夫斯基(Vladimir Yaroslavskiy)推出的新的双轴Quicksort,自版本7开始在Oracle的Java运行时库中使用,具有令人着迷的不对称性。与经典的单轴Quicksort相比,它们使该算法的基本变体使用的比较少。在本文中,我们将分析扩展到选择两个支点作为随机样本的固定顺序统计量的情况。出乎意料的是,双轴Quicksort比经典Quicksort的相应版本需要更多的比较,因此很明显,计数比较不足以解释Yaroslavskiy算法在实践中观察到的运行时间优势。因此,我们采用了更全面的方法,并给出了平均交换次数,执行的Java字节码指令的数量和扫描的元素的数量的精确前置项,这是一种新的简单成本度量,它近似于内存中的I / O成本层次结构。我们为每种成本度量确定最佳订单统计信息。事实证明,Yaroslavskiy算法中的不对称性使具有系统性偏斜的枢轴比对称选择更为有效。此外,对于Yaroslavskiy算法在实践中的成功,我们最终有一个令人信服的解释:与经典单轴Quicksort的相应版本相比,双轴Quicksort在有和没有轴采样的情况下都需要更少的I / O。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号