快速排序对多个相等键是最优的
Quicksort Is Optimal For Many Equal Keys
摘要:
我证明了平均比较数为中位数的$k$快速排序(与脂肪枢轴a.k.a.三向划分)渐近地仅比用于对具有每个值的$Ω(n^\varepsilon)$重复的随机多集进行排序的下限差恒定$α_k$倍(对于任何$\varepsilon>0$)。常数是$α_k = \ln(2) / \bigl(H_{k+1}-H_{(k+1)/2} \bigr)$,它以$k\to\infty$的形式收敛到1,因此快速排序对于有许多重复的输入是渐进最优的。这解决了Sedgewick和Bentley(1999,2002)的一个猜想,并构成了自Sedgewick 1977年的文章以来,在分析具有相等元素的快速排序方面的第一个进展。
英文摘要:
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 $α_k$ times worse than the lower bound for sorting random multisets with $Ω(n^\varepsilon)$ duplicates of each value (for any $\varepsilon>0$). The constant is $α_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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。