skip to main content
article
Free Access

The input/output complexity of sorting and related problems

Published:01 September 1988Publication History
Skip Abstract Section

Abstract

We provide tight upper and lower bounds, up to a constant factor, for the number of inputs and outputs (I/OS) between internal memory and secondary storage required for five sorting-related problems: sorting, the fast Fourier transform (FFT), permutation networks, permuting, and matrix transposition. The bounds hold both in the worst case and in the average case, and in several situations the constant factors match. Secondary storage is modeled as a magnetic disk capable of transferring P blocks each containing B records in a single time unit; the records in each block must be input from or output to B contiguous locations on the disk. We give two optimal algorithms for the problems, which are variants of merge sorting and distribution sorting. In particular we show for P = 1 that the standard merge sorting algorithm is an optimal external sorting method, up to a constant factor in the number of I/Os. Our sorting algorithms use the same number of I/Os as does the permutation phase of key sorting, except when the internal memory size is extremely small, thus affirming the popular adage that key sorting is not faster. We also give a simpler and more direct derivation of Hong and Kung's lower bound for the FFT for the special case B = P = O(1).

References

  1. 1 Beigel, R., and Gill, J. Personal Communication. 1986.Google ScholarGoogle Scholar
  2. 2 Blum, M., Floyd, R.W., Pratt, V., Rivest, R.L., and Tarjan, R.E. Time bounds for selection. }. Comput. Syst. Sci. 7 (1973), 448-461.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3 Floyd, R.W. Permuting information in idealized two-l, evel storage. In Complexity of Computer Calculations, R. Miller and J. Thatcher, Eds. Plenum, New York, 1972, pp. 105-109.Google ScholarGoogle Scholar
  4. 4 Hong, J.W., and Kung, H.T. I/O complexity: The red-blue pebble game. In Proceedings of the 13th Annual ACM Symposium on Theory of Computing (Milwaukee, Wisconsin, Oct.}. pp. 326-333. 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5 Knuth, D.E. The Art of Computer Programming, Volume III: Sorting and Searching. Addison-Wesley, Reading, Mass., 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 Kwan, S.C., and Baer, J.L. The I/O performance of multiway mergesort and tag sort. IEEE Trans. Comput. C-34, 4 (Apr. 1985), 383-387.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 Leighton, F.T. Tight bounds on the complexity of parallel sorting. IEEE Trans. Comput. C-34, 4 (Apr. 1985). Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8 Lindstrom, E.E., and Vitter, J.S. The design and analysis of Bucket- Sort for bubble memory secondary storage. IEEE Trans. Comput. C-34, 3 (Mar. 1985), 218-233.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9 Savage, J.E., and Vitter, }.S. Parallelism in space-time tradeoffs, in Advances in Computing Research, Volume 4: Special Issue on Parallel and Distributed Computing. JAI Press, Greenwich, Conn., 1987, pp. 117-146.Google ScholarGoogle Scholar
  10. 10 Wu, C.L., and Feng, T.Y. The universality of the shuffle-exchange network. IEEE Trans. Comput. C-30, 5 (May 1981), 324-332.Google ScholarGoogle Scholar

Index Terms

  1. The input/output complexity of sorting and related problems

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                Full Access

                • Published in

                  cover image Communications of the ACM
                  Communications of the ACM  Volume 31, Issue 9
                  Sept. 1988
                  109 pages
                  ISSN:0001-0782
                  EISSN:1557-7317
                  DOI:10.1145/48529
                  Issue’s Table of Contents

                  Copyright © 1988 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 1 September 1988

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • article

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader