Results 1 
6 of
6
On the adaptiveness of quicksort
 IN: WORKSHOP ON ALGORITHM ENGINEERING & EXPERIMENTS, SIAM
, 2005
"... 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 adapti ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
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 which 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 when the input is already sorted. 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 the Quicksort algorithm. We also give some empirical results on the adaptive behavior of Heapsort and Mergesort.
On the Adaptiveness of Quicksort Gerth Sto/lting Brodal*, # Rolf Fagerberg##, $ Gabriel Moruz*
, 2004
"... Abstract Quicksort was first introduced in 1961 by Hoare. Many variantshave been developed, the best of which are among the fastest generic sorting algorithms available, as testified by the choice of Quicksort asthe default sorting algorithm in most programming libraries. Some sorting algorithms are ..."
Abstract
 Add to MetaCart
Abstract Quicksort was first introduced in 1961 by Hoare. Many variantshave been developed, the best of which are among the fastest generic sorting algorithms available, as testified by the choice of Quicksort asthe default sorting algorithm in most programming libraries. Some sorting algorithms are adaptive, i.e. they have a complexity analysiswhich is better for inputs which are nearly sorted, according to some specified measure of presortedness. Quicksort is not among these, asit uses \Omega ( n log n) comparisons even when the input is already sorted.However, in this paper we demonstrate empirically that the actual running time of Quicksort is adaptive with respect to the presortednessmeasure 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 inversionsin the input sequence. This result provides a theoretical explanation
and
"... We study the performance of the most practical inversionsensitive internal sorting algorithms. Experimental results illustrate that adaptive AVL sort consumes the fewest number of comparisons unless the number of inversions is less than 1%; in such case Splaysort consumes the fewest number of compa ..."
Abstract
 Add to MetaCart
We study the performance of the most practical inversionsensitive internal sorting algorithms. Experimental results illustrate that adaptive AVL sort consumes the fewest number of comparisons unless the number of inversions is less than 1%; in such case Splaysort consumes the fewest number of comparisons. On the other hand, the running time of Quicksort is superior unless the number of inversions is less than 1.5%; in such case Splaysort has the shortest running time. Another interesting result is that although the number of cache misses for the cacheoptimal Greedysort algorithm was the least, compared to other adaptive sorting algorithms under investigation, it was outperformed by Quicksort.
A HeapBased Optimal InversionsSensitive Sorting Algorithm
, 2003
"... this paper, we describe a new timeoptimal algorithm that makes n lg(I=n) + O(n lg lg(I=n) + n) comparisons. This is an optimal algorithm for inversionssensitive sorting in the sense that it is timeoptimal and the number of comparisons it performs matches the informationtheoretic lower bound up t ..."
Abstract
 Add to MetaCart
this paper, we describe a new timeoptimal algorithm that makes n lg(I=n) + O(n lg lg(I=n) + n) comparisons. This is an optimal algorithm for inversionssensitive sorting in the sense that it is timeoptimal and the number of comparisons it performs matches the informationtheoretic lower bound up to lower order terms. (To be precise, the number of comparisons performed by our algorithm is optimal with respect to its leading term and near optimal with respect to the second term. This is explained in the following section.) 2 Earlier Results Adaptive sorting using the nger trees data structure introduced in [GMPR77], was the rst inversionssensitive timeoptimal sorting algorithm. Mehlhorn [Me79] introduced an algorithm with the same time bounds as nger trees. Both of these algorithms are considered impractical. As summarized by Elmasry [El02], other algorithms that are timeoptimal and inversionssensitive are Blocksort [LP96] which runs in place and treebased Mergesort [MEP96] which is timeoptimal with respect to several other measures of presortedness
Abstract On the Adaptiveness of Quicksort
"... 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 which is bett ..."
Abstract
 Add to MetaCart
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 which 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 when the input is already sorted. 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 the Quicksort algorithm. We also give some empirical results on the adaptive behavior of Heapsort and Mergesort. 1
Adaptive Algorithms for Planar Convex Hull Problems?
"... Abstract. We study problems in computational geometry from the viewpoint of adaptive algorithms. Adaptive algorithms have been extensively studied for the sorting problem, and in this paper we generalize the framework to geometric problems. To this end, we think of geometric problems as permutation ..."
Abstract
 Add to MetaCart
Abstract. We study problems in computational geometry from the viewpoint of adaptive algorithms. Adaptive algorithms have been extensively studied for the sorting problem, and in this paper we generalize the framework to geometric problems. To this end, we think of geometric problems as permutation (or rearranging) problems of arrays, and define the “presortedness ” as a distance from the input array to the desired output array. We call an algorithm adaptive if it runs faster when a given input array is closer to the desired output, and furthermore it does not make use of any information of the presortedness. As a case study, we look into the planar convex hull problem for which we discover two natural formulations as permutation problems. An interesting phenomenon that we prove is that for one formulation the problem can be solved adaptively, but for the other formulation no adaptive algorithm can be better than an optimal outputsensitive algorithm for the planar convex hull problem. 1