Abstract
A sorting algorithm is adaptive if it sorts sequences that are close to sorted faster than it sorts random sequences, where the distance is determined by some measure of presortedness. Over the years several measures of presortedness have been proposed in the literature, but it has been far from clear how they relate to each other. We show that there exists a natural partial order on the set of measures, which makes it possible to say that some measures are superior to others. We insert all known measures of presortedness into the partial order, and thereby provide a powerful tool for evaluating both measures and adaptive sorting algorithms. We further present a new measure and show that it is a maximal known element in the partial order, and thus that any sorting algorithm that optimally adapts to the new measure also optimally adapts to all other known measures of presortedness.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
W.H. Burge. Sorting, trees, and measures of order. Inform. and Control, 1:181–197, 1958.
S. Carlsson, C. Levcopoulos, and O. Petersson. Sublinear merging and Natural Mergesort. Algorithmica. To appear. Prel. version in Proc. Internat. Symp. on Algorithms, pages 251–260, LNCS 450, Springer-Verlag, 1990.
C.R. Cook and D.J. Kim. Best sorting algorithms for nearly sorted lists. Comm. ACM, 23:620–624, 1980.
G.R. Dromey. Exploiting partial order with Quicksort. Software—Practice and Experience, 14:509–518, 1984.
V. Estivill-Castro and D. Wood. A new measure of presortedness. Inform. and Comput., 83:111–119, 1989.
M.L. Fredman. How good is the information theory bound in sorting? Theoret. Comput. Sci., 1:355–361, 1976.
J. Katajainen, C. Levcopoulos, and O. Petersson. Local Insertion Sort revisited. In Proc. Internat. Symp. on Optimal Algorithms, pages 239–253. LNCS 401, Springer-Verlag, 1989.
D.E. Knuth. The Art of Computer Programming, Vol. 3: Sorting and Searching. Addison-Wesley, Reading, MA, 1973.
C. Levcopoulos and O. Petersson. Adaptive Heapsort. J. Algorithms. To appear. Prel. version in Proc. 1989 Workshop on Algorithms and Data Structures, pages 499–509, LNCS 382, Springer-Verlag, 1989.
C. Levcopoulos and O. Petersson. Sorting shuffled monotone sequences. Inform. and Comput. To appear. Prel. version in Proc. 2nd Scandinavian Workshop on Algorithm Theory, pages 181–191, LNCS 447, Springer-Verlag, 1990.
H. Mannila. Measures of presortedness and optimal sorting algorithms. IEEE Trans. Comput., C-34:318–325, 1985.
K. Mehlhorn. Data Structures and Algorithms, Vol. 1: Sorting and Searching. Springer-Verlag, Berlin, Germany, 1984.
A.M. Moffat and O. Petersson. Historical searching and sorting. In Proc. Internat. Symp. on Algorithms, pages 263–272. LNCS 557, Springer-Verlag, 1991.
O. Petersson. Adaptive Sorting. PhD thesis, Department of Computer Science, Lund Univ., Lund, Sweden, 1990.
S.S. Skiena. Encroaching lists as a measure of presortedness. BIT, 28:775–784, 1988.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Petersson, O., Moffat, A. (1992). A framework for adaptive sorting. In: Nurmi, O., Ukkonen, E. (eds) Algorithm Theory — SWAT '92. SWAT 1992. Lecture Notes in Computer Science, vol 621. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55706-7_38
Download citation
DOI: https://doi.org/10.1007/3-540-55706-7_38
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55706-7
Online ISBN: 978-3-540-47275-9
eBook Packages: Springer Book Archive