Abstract
We present a new sorting algorithm which adapts to existing order within the input sequence. Let k be the smallest integer such that a sequence X of length n can be reduced to the empty sequence by the removal of k monotone, increasing or decreasing, subsequences. The algorithm, Slabsort, sorts X in O(n log k) time, without knowing k beforehand, which is optimal in a comparison-based model. In the worst case Slabsort degenerates to a hybrid of Melsort and Exact Quicksort and runs in Θ(n log n) time. Further, k is shown to capture various kinds of existing order proposed in the literature.
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho, J.E. Hopcroft, and J.D. Ullman. Data Structures and Algorithms. Addison-Wesley, Reading, Mass., 1983.
A. Brandstädt and D. Kratsch. On partitions of permutations into increasing and decreasing subsequences. Journal of Information Processing and Cybernetics, 22(5/6):263–273, 1986.
S. Carlsson, C. Levcopoulos, and O. Petersson. Sublinear merging and Natural Merge Sort. In Proc. SIGAL International Symposium on Algorithms. LNCS, Springer-Verlag, 1990. To appear.
C.R. Cook and D.J. Kim. Best sorting algorithms for nearly sorted lists. Communications of the ACM, 23(11):620–624, 1980.
G.R. Dromey. Exploiting partial order with Quicksort. Software—Practice and Experience, 14(6):509–518, 1984.
V. Estivill-Castro, H. Mannila, and D. Wood. Right invariant metrics and measures of presortedness. Research Report CS-89-30, University of Waterloo, Department of Computer Science, Waterloo, Canada, 1989.
V. Estivill-Castro and D. Wood. A new measure of presortedness. Information and Computation, 83(1):111–119, 1989.
M.L. Fredman. On computing the length of longest increasing subsequences. Discrete Mathematics, 11:29–35, 1975.
D.E. Knuth. The Art of Computer Programming, Vol. 3: Sorting and Searching. Addison-Wesley, Reading, Mass., 1973.
C. Levcopoulos and O. Petersson. Heapsort—adapted for presorted files. In Proc. 1989 Workshop on Algorithms and Data tructures, pages 499–509. LNCS 382, Springer-Verlag, 1989.
C. Levcopoulos and O. Petersson. Splitsort—an adaptive sorting algorithm. In Proc. Fifteenth Symposium on Mathematical Foundations of Computer Science. LNCS, Springer-Verlag, 1990. To appear.
H. Mannila. Measures of presortedness and optimal sorting algorithms. IEEE Transactions on Computers, C-34(4):318–325, 1985.
K. Mehlhorn. Sorting presorted files. In Proc. 4th GI Conference on Theoretical Computer Science, pages 199–212. LNCS 67, Springer-Verlag, 1979.
K. Mehlhorn. Data Structures and Algorithms, Vol 1: Sorting and Searching. Springer-Verlag, Berlin/Heidelberg, F.R. Germany, 1984.
C. Schensted. Longest increasing and decreasing subsequences. Canadian Journal of Mathematics, 13:179–191, 1961.
S.S. Skiena. Encroaching lists as a measure of presortedness. BIT, 28(4):775–784, 1988.
K. Wagner. Monotonic coverings of finite sets. Journal of Information Processing and Cybernetics, 20(12):633–639, 1984.
R.L. Wainwright. A class of sorting algorithms based on Quicksort. Communications of the ACM, 28(4):396–402, 1985.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1990 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Levcopoulos, C., Petersson, O. (1990). Sorting shuffled monotone sequences. In: Gilbert, J.R., Karlsson, R. (eds) SWAT 90. SWAT 1990. Lecture Notes in Computer Science, vol 447. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-52846-6_88
Download citation
DOI: https://doi.org/10.1007/3-540-52846-6_88
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-52846-3
Online ISBN: 978-3-540-47164-6
eBook Packages: Springer Book Archive