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.
This research was partially supported by the Academy of Finland. A preliminary version of some of the results is published in the doctoral dissertation [1].
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Saikkonen, R.: Bulk Updates and Cache Sensitivity in Search Trees. PhD thesis, Helsinki University of Technology (2009)
Carlsson, S., Levcopoulos, C., Petersson, O.: Sublinear merging and natural mergesort. Algorithmica 9(6), 629–648 (1993)
Mehlhorn, K.: Sorting Presorted Files. In: Weihrauch, K. (ed.) GI-TCS 1979. LNCS, vol. 67, pp. 199–212. Springer, Heidelberg (1979)
Petersson, O., Moffat, A.: A framework for adaptive sorting. Discrete Applied Mathematics 59(2), 153–179 (1995)
Saikkonen, R., Soisalon-Soininen, E.: Bulk-Insertion Sort: Towards Composite Measures of Presortedness. In: Vahrenhold, J. (ed.) SEA 2009. LNCS, vol. 5526, pp. 269–280. Springer, Heidelberg (2009)
Moffat, A., Eddy, G., Petersson, O.: Splaysort: Fast, versatile, practical. Software, Practice and Experience 126(7), 781–797 (1996)
Mannila, H.: Measures of presortedness and optimal sorting algorithms. IEEE Transactions on Computers C-34, 318–325 (1985)
Cole, R.: On the dynamic finger conjecture for splay trees, part II: The proof. SIAM Journal on Computing 30(1), 44–85 (2000)
Fredman, M.L.: Two applications of a probabilistic search technique: Sorting X+Y and building balanced search trees. In: 7th Annual ACM Symposium on Theory of Computing (STOC 1975), pp. 240–244. ACM Press (1975)
Elmasry, A., Hammad, A.: An Empirical Study for Inversions-Sensitive Sorting Algorithms. In: Nikoletseas, S.E. (ed.) WEA 2005. LNCS, vol. 3503, pp. 597–601. Springer, Heidelberg (2005)
Levcopoulos, C., Petersson, O.: Splitsort – an adaptive sorting algorithm. Information Processing Letters 39, 205–211 (1991)
Estivill-Castro, V., Wood, D.: A survey of adaptive sorting algorithms. ACM Computing Surveys 24(4), 441–476 (1992)
Bentley, J.L., McIlroy, M.D.: Engineering a sort function. Software, Practice and Experience 23(11), 1249–1265 (1993)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Saikkonen, R., Soisalon-Soininen, E. (2012). A General Method for Improving Insertion-Based Adaptive Sorting. In: Chao, KM., Hsu, Ts., Lee, DT. (eds) Algorithms and Computation. ISAAC 2012. Lecture Notes in Computer Science, vol 7676. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35261-4_25
Download citation
DOI: https://doi.org/10.1007/978-3-642-35261-4_25
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-35260-7
Online ISBN: 978-3-642-35261-4
eBook Packages: Computer ScienceComputer Science (R0)