首页> 外文会议> >Optimal Dual-Pivot Quicksort: Exact Comparison Count
【24h】

Optimal Dual-Pivot Quicksort: Exact Comparison Count

机译:最佳双轴Quicksort:精确比较计数

获取原文

摘要

Quicksort, proposed by Hoare in 1961, is a venerable sorting algorithm - it has been thoroughly analyzed, it is taught in basic algorithms classes, and it is routinely used in practice. Can there be anything new about Quicksort today? 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. Algorithms of this type had been studied by Sedgewick (1975) and by Hennequin (1991), with no further consequences. They received new attention starting from 2009, when a dual-pivot algorithm due to Yaroslavskiy, Bentley, and Bloch replaced the well-engineered quicksort algorithm in Oracle's Java 7 runtime library. An analysis of a variant of this algorithm by Nebel and Wild from 2012, where the two pivots are chosen randomly, showed there are about 1.9n ln n comparisons on average for n input numbers. (Other works ensued. Standard quicksort has 2n ln n expected comparisons. It should be noted that on modem computers parameters other than the comparison count will determine the running time.) In the center of the analysis is the partitioning procedure. Given two pivots, it splits the input keys in 'small' (smaller than small pivot), 'medium' (between the two pivots), 'large' (larger than large pivot). We identify a partitioning strategy with the minimum average number of key comparisons in the case where the pivots are chosen from a random sample. The strategy keeps count of how many large and small elements were seen before and prefers the corresponding pivot. The comparison count is closely related to a 'random walk' on the integers which keeps track of the difference of large and small elements seen so far. An alternative way of understanding what is going on is a Polya urn with three colors. For the fine analysis it is essential to understand the expected number of times this random walk hits zero. The expected number of comparisons can be determined exactly and as a formula up to lower terms: It is 1.8n ln n + 2.38..n+ 1.675 ln n + O(1). Extensions to larger numbers of pivots will be discussed.
机译:Hoare于1961年提出的Quicksort是一种古老的排序算法-经过全面分析,在基本算法课程中进行了讲授,并且在实践中经常使用。今天Quicksort有什么新消息吗? Dual-pivot快速排序是指经典快速排序的变体,其中在分区步骤中,使用两个枢轴将输入分为三个部分。 Sedgewick(1975)和Hennequin(1991)对这种类型的算法进行了研究,没有进一步的后果。从2009年开始,他们受到了新的关注,当时Yaroslavskiy,Bentley和Bloch提出的双轴算法取代了Oracle Java 7运行时库中精心设计的quicksort算法。 Nebel和Wild从2012年开始对这种算法的变体进行了分析,其中两个枢轴是随机选择的,结果表明,对于n个输入数字,平均有1.9n ln n个比较。 (随之而来的其他工作。标准快速排序有2n ln n个预期的比较。应该注意的是,在现代计算机上,比较计数以外的其他参数将确定运行时间。)分析的中心是分区过程。给定两个枢轴,它将输入键分为“小”(小于小枢轴),“中”(两个枢轴之间),“大”(大于大枢轴)。在从随机样本中选择枢轴的情况下,我们用最小的键比较平均数来确定一种分区策略。该策略保留了之前看到过多少个大大小小的元素的计数,并且倾向于相应的枢轴。比较计数与整数上的“随机游动”密切相关,该游动可跟踪到目前为止看到的大小元素的差异。了解发生了什么情况的另一种方法是三种颜色的Polya ur。为了进行精细分析,必须了解此随机游走达到零的预期次数。可以比较准确地确定期望的比较数,并且可以使用公式来确定较低的项:它是1.8n ln n + 2.38..n + 1.675 ln n + O(1)。将讨论更多数量的枢轴扩展。

著录项

  • 来源
    《》|2017年|qt014-qt014|共1页
  • 会议地点 Bordeaux(FR)
  • 作者

    Martin Dietzfelbinger;

  • 作者单位

    Technische Universitaet Ilmenau Fakultaet fuer Informatik und Automatisierung Fachgebiet Komplexitaetstheorie und Effiziente Algorithmen P.O. Box 100565 98684 Ilmenau Germany;

  • 会议组织
  • 原文格式 PDF
  • 正文语种
  • 中图分类
  • 关键词

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号