The I/O complexity of sorting and related problems

extended abstract
  • Alok Aggarwal
  • Jeffrey Scott Vitter
Algorithms And Complexity
Part of the Lecture Notes in Computer Science book series (LNCS, volume 267)


We provide tight upper and lower bounds, up to a constant factor, for the number of accesses (I/Os) to secondary storage required for four sorting-related problems: sorting, the fast Fourier transform (FFT), permutation networks, and permuting records. The bounds hold both in the worst case and in the average case. Secondary storage is modeled as a magnetic disk capable of transfering 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. 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 substantiating the popular adage that key sorting is not better. We also give a simpler and more direct derivation of a result due to Hong and Kung, which gives the FFT lower bound for the special case B=P=O(1).


Fast Fourier Transform Internal Memory Single Track Magnetic Disk Block Transfer 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. R. Beigel and J. Gill. Personal communication (1986).Google Scholar
  2. M. Blum, R. W. Floyd, V. Pratt, R. L. Rivest, and R. E. Tarjan. “Time Bounds for Selection,” Journal of Computer and System Sciences, 7 (1973), 448–461.Google Scholar
  3. R. W. Floyd. “Permuting Information in Idealized Two-Level Storage,” Complexity of Computer Calculations, Plenum, New York (1972), 105–109.Google Scholar
  4. Hong J. W. and H. T. Kung. “I/O Complexity: The Red-Blue Pebble Game,” Proceedings of the 13th Annual ACM Symposium on Theory of Computing, Milwaukee, WI (October 1981), 326–333.Google Scholar
  5. D. E. Knuth. The Art of Computer Programming. Volume III: Sorting and Searching. Addison-Wesley, Reading, MA (1973).Google Scholar
  6. F. T. Leighton. “Tight Bounds on the Complexity of Parallel Sorting,” IEEE Transactions on Computers, C-34(4), Special Issue on Sorting (April 1985).Google Scholar
  7. E. E. Lindstrom and J. S. Vitter. “The Design and Analysis of BucketSort for Bubble Memory Secondary Storage,” IEEE Transactions on Computers, C-34(3) (March 1985), 218–233.Google Scholar
  8. J. E. Savage and J. S. Vitter. “Parallelism in Space-Time Tradeoffs,” Advances in Computing Research, Volume 4: Special Issue on Parallel and Distributed Computing, JAI Press, Greenwich, CT (1987), 117–146.Google Scholar
  9. C. L. Wu and T. Y. Feng. “The Universality of the Shuffle-Exchange Network,” IEEE Transactions on Computers, C-30(5) (May 1981), 324–332.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1987

Authors and Affiliations

  • Alok Aggarwal
    • 1
  • Jeffrey Scott Vitter
    • 2
  1. 1.IBM Watson Research CenterYorktown HeightsUSA
  2. 2.I. N. R. I. A., Domaine de Voluceau, RocquencourtLe Chesnay CedexFrance

Personalised recommendations