A survey of adaptive sorting algorithms
ACM Computing Surveys (CSUR)
Software—Practice & Experience
A framework for adaptive sorting
Discrete Applied Mathematics
The art of computer programming, volume 3: (2nd ed.) sorting and searching
The art of computer programming, volume 3: (2nd ed.) sorting and searching
Implementing Quicksort programs
Communications of the ACM
Communications of the ACM
Communications of the ACM
Communications of the ACM
A high-speed sorting procedure
Communications of the ACM
Optimal Sampling Strategies in Quicksort and Quickselect
SIAM Journal on Computing
Priority Queues, Pairing, and Adaptive Sorting
ICALP '02 Proceedings of the 29th International Colloquium on Automata, Languages and Programming
Sorting and/by Merging Finger Trees
ISAAC '92 Proceedings of the Third International Symposium on Algorithms and Computation
Adaptive Sorting and the Information Theoretic Lower Bound
STACS '03 Proceedings of the 20th Annual Symposium on Theoretical Aspects of Computer Science
Analysis of Shellsort and Related Algorithms
ESA '96 Proceedings of the Fourth Annual European Symposium on Algorithms
An In-Place Sorting with O(n log n) Comparisons and O(n) Moves
FOCS '03 Proceedings of the 44th Annual IEEE Symposium on Foundations of Computer Science
Cache-aware and cache-oblivious adaptive sorting
ICALP'05 Proceedings of the 32nd international conference on Automata, Languages and Programming
Tradeoffs between branch mispredictions and comparisons for sorting algorithms
WADS'05 Proceedings of the 9th international conference on Algorithms and Data Structures
An empirical study for inversions-sensitive sorting algorithms
WEA'05 Proceedings of the 4th international conference on Experimental and Efficient Algorithms
Two constant-factor-optimal realizations of adaptive heapsort
IWOCA'11 Proceedings of the 22nd international conference on Combinatorial Algorithms
The weak-heap data structure: Variants and applications
Journal of Discrete Algorithms
Hi-index | 0.00 |
Quicksort was first introduced in 1961 by Hoare. Many variants have been developed, the best of which are among the fastest generic-sorting algorithms available, as testified by the choice of Quicksort as the default sorting algorithm in most programming libraries. Some sorting algorithms are adaptive, i.e., they have a complexity analysis that is better for inputs, which are nearly sorted, according to some specified measure of presortedness. Quicksort is not among these, as it uses Ω(n log n) comparisons even for sorted inputs. However, in this paper, we demonstrate empirically that the actual running time of Quicksort is adaptive with respect to the presortedness measure Inv. Differences close to a factor of two are observed between instances with low and high Inv value. We then show that for the randomized version of Quicksort, the number of element swaps performed is provably adaptive with respect to the measure Inv. More precisely, we prove that randomized Quicksort performs expected O(n(1 + log(1 + Inv/n))) element swaps, where Inv denotes the number of inversions in the input sequence. This result provides a theoretical explanation for the observed behavior and gives new insights on the behavior of Quicksort. We also give some empirical results on the adaptive behavior of Heapsort and Mergesort.