SIGAL 1990: Algorithms pp 251-260 | Cite as
Sublinear merging and natural merge sort
Abstract
The complexity of merging two sorted sequences into one is linear in the worst case as well as in the average case. There are, however, instances for which a sublinear number of comparisons is sufficient. We consider the problem of measuring and exploiting such instance easiness. The merging algorithm presented, Adaptmerge, is shown to optimally adapt to different kinds of measures of instance easiness. In the sorting problem, the concept of instance easiness has received a lot of attention and is interpreted by a measure of presortedness. We apply Adaptmerge in the already adaptive sorting algorithm Natural Merge Sort. The resulting algorithm optimally adapts to several, known and new, measures of presortedness. We also prove some interesting results concerning the relation between measures of presortedness proposed in the literature.
Keywords
Linear Time Binary Search Sorting Algorithm Merging Algorithm Sorting ProblemPreview
Unable to display preview. Download preview PDF.
References
- [1]T. Altman and Y. Igarashi. Roughly sorting: sequential and parallel approach. Journal of Information Processing, 12(2):154–158, 1989.MathSciNetGoogle Scholar
- [2]V. Estivill-Castro and D. Wood. A new measure of presortedness. Information and Computation, 83(1):111–119, 1989.CrossRefGoogle Scholar
- [3]E. Horowitz and S. Sahni. Fundamentals of Computer Algorithms. Computer Science Press, Rockville, Maryland, 1984.Google Scholar
- [4]C. Levcopoulos and O. Petersson. Heapsort—adapted for presorted files. In Proc. 2nd SWAT. LNCS, Springer-Verlag, 1990. To appear.Google Scholar
- [6]H. Mannila. Measures of presortedness and optimal sorting algorithms. IEEE Transactions on Computers, C-34(4):318–325, 1985.Google Scholar
- [7]K. Mehlhorn. Data Structures and Algorithms, Vol 1: Sorting and Searching. 1984.Google Scholar
- [8]S.S. Skiena. Encroaching lists as a measure of presortedness. BIT, 28(4):775–784, 1988.MathSciNetGoogle Scholar