Adaptive Shivers Sort: An Alternative Sorting Algorithm
Vincent Jugé
摘要
We present a new sorting algorithm, called adaptive ShiversSort, that exploits the existence of monotonic runs for sorting efficiently partially sorted data. This algorithm is a variant of the wellknown algorithm TimSort, which is the sorting algorithm used in standard libraries of programming languages such as Python or Java (for non-primitive types). More precisely, adaptive ShiversSort is a so-called k-aware merge-sort algorithm, a class that was introduced by Buss and Knop that captures "TimSort-like" algorithms.
In this article, we prove that, although adaptive ShiversSort is simple to implement and differs only slightly from TimSort, its computational cost, in number of comparisons performed, is optimal within the class of natural merge-sort algorithms, up to a small additive linear term: this makes adaptive ShiversSort the first k-aware algorithm to benefit from this property, which is also a 33% improvement over TimSort's worst-case. This suggests that adaptive ShiversSort could be a strong contender for being used instead of TimSort.
Then, we investigate the optimality of k-aware algorithms: we give lower and upper bounds on the best approximation factors of such algorithms, compared to optimal stable natural merge-sort algorithms. In particular, we design generalisations of adaptive ShiversSort whose computational costs are optimal up to arbitrarily small multiplicative factors.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper1
问问它们各自怎么用它相关 Paper
- An Optimal Algorithm for Sorting Pattern-Avoiding SequencesMichal OplerFOCS 2024 · 被引用 1 次
- Parallel Integer Sort: Theory and PracticeXiaojun Dong, Laxman Dhulipala, Yan Gu, Yihan SunPPoPP 2024 · 被引用 9 次
- Sorting Compressed Time SeriesZhiheng Liu, Xingyu Liu, Shaoxu Song, Jianmin WangICDE 2026
- Fast and Simple Sorting Using Partial InformationBernhard Haeupler, Richard Hladík, John Iacono, Václav Rozhon 等SODA 2025 · 被引用 3 次
- Flexway O-Sort: Enclave-Friendly and Optimal Oblivious SortingTianyao Gu, Yilei Wang, Afonso Tinoco, Bingnan Chen 等USENIX Security 2025
