Quicksort Is Optimal For Many Equal Keys

Sebastian Wild
{"title":"Quicksort Is Optimal For Many Equal Keys","authors":"Sebastian Wild","doi":"10.1137/1.9781611975062.2","DOIUrl":null,"url":null,"abstract":"I prove that the average number of comparisons for median-of-$k$ Quicksort (with fat-pivot a.k.a. three-way partitioning) is asymptotically only a constant $\\alpha_k$ times worse than the lower bound for sorting random multisets with $\\Omega(n^\\varepsilon)$ duplicates of each value (for any $\\varepsilon>0$). The constant is $\\alpha_k = \\ln(2) / \\bigl(H_{k+1}-H_{(k+1)/2} \\bigr)$, which converges to 1 as $k\\to\\infty$, so Quicksort is asymptotically optimal for inputs with many duplicates. This resolves a conjecture by Sedgewick and Bentley (1999, 2002) and constitutes the first progress on the analysis of Quicksort with equal elements since Sedgewick's 1977 article.","PeriodicalId":340112,"journal":{"name":"Workshop on Analytic Algorithmics and Combinatorics","volume":"19 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-08-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Workshop on Analytic Algorithmics and Combinatorics","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1137/1.9781611975062.2","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

I prove that the average number of comparisons for median-of-$k$ Quicksort (with fat-pivot a.k.a. three-way partitioning) is asymptotically only a constant $\alpha_k$ times worse than the lower bound for sorting random multisets with $\Omega(n^\varepsilon)$ duplicates of each value (for any $\varepsilon>0$). The constant is $\alpha_k = \ln(2) / \bigl(H_{k+1}-H_{(k+1)/2} \bigr)$, which converges to 1 as $k\to\infty$, so Quicksort is asymptotically optimal for inputs with many duplicates. This resolves a conjecture by Sedgewick and Bentley (1999, 2002) and constitutes the first progress on the analysis of Quicksort with equal elements since Sedgewick's 1977 article.
快速排序对于许多相等的键是最优的
我证明了对于中位数($k$)快速排序(使用胖枢轴,也就是三向划分)的平均比较次数,其渐进地仅仅是一个常数$\alpha_k$倍于对每个值有$\Omega(n^\varepsilon)$个重复的随机多集排序的下界(对于任意$\varepsilon>0$)。常数是$\alpha_k = \ln(2) / \bigl(H_{k+1}-H_{(k+1)/2} \bigr)$,收敛到1为$k\to\infty$,所以对于有很多重复项的输入,快速排序是渐近最优的。这解决了Sedgewick和Bentley(1999, 2002)的一个猜想,并构成了自Sedgewick 1977年的文章以来对具有等元素的快速排序分析的第一个进展。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信