TL;DR: Experimental results showing that Splaysort - sorting by repeated insertion into a Splay tree - is a surprisingly efficient method for in-memory sorting and appears to be adaptive with respect to all accepted measures of presortedness.
Abstract: Adaptivity in sorting algorithms is sometimes gained at the expense of practicality. We give experimental results showing that Splaysort - sorting by repeated insertion into a Splay tree - is a surprisingly efficient method for in-memory sorting. Splaysort appears to be adaptive with respect to all accepted measures of presortedness, and it outperforms Quicksort for sequences with modest amounts of existing order. Although Splaysort has a linear space overhead, there are many applications for which this is reasonable. In these situations Splaysort is an attractive alternative to traditional comparison-based sorting algorithms such as Heapsort, Mergesort, and Quicksort.
TL;DR: 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 has the shortest running time.
Abstract: We study the performance of the most practical inversion-sensitive internal sorting algorithms. Experimental results illustrate that adaptive AVL sort consumes the fewest number of comparisons unless the number of inversions is less than 1p; 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.5p; in such case Splaysort has the shortest running time. Another interesting result is that although the number of cache misses for the cache-optimal Greedysort algorithm was the least, compared to other adaptive sorting algorithms under investigation, it was outperformed by Quicksort.
TL;DR: Experimental results show that adaptive AVL sort performs the least number of comparisons unless the number of inversions is fewer than 1%.
Abstract: We study the performance of the most practical internal adaptive sorting algorithms. Experimental results show that adaptive AVL sort performs the least number of comparisons unless the number of inversions is fewer than 1%. In such case, Splaysort performs the fewest number of comparisons. On the other hand, the running time of Quicksort is superior unless the number of inversions is fewer than 1.5%. In such case, Splaysort consumes the smallest running time.
TL;DR: A new natural measure of presortedness is introduced, which is a composition of two existing ones: Block that gives the number of already sorted disjoint subsequences of the input, and Loc defined as \(\prod^{n}_{i=2} d_i\), where d i denotes the distance between the (i − 1)th and the ith element of theinput in the ordered sequence up to the itH element.
Abstract: A presortedness measure describes to which extent a sequence of key values to be sorted is already partially sorted. We introduce a new natural measure of presortedness, which is a composition of two existing ones: Block that gives the number of already sorted disjoint subsequences of the input, and Loc defined as \(\prod^{n}_{i=2} d_i\), where d i denotes the distance between the (i − 1)th and the ith element of the input in the ordered sequence up to the ith element. We also give a general method for improving insertion-based adaptive sorting, applying it to Splaysort to produce an algorithm that is optimal with respect to the new composite measure. Our experiments are performed for splay-tree sorting which has been reported to be among the most efficient adaptive sorting algorithms. Our experimental results show that, in addition to the theoretical superiority, our method improves standard Splaysort by a large factor when the input contains blocks of reasonable size.