Abstract
A priority queue Q is a data structure that maintains a collection of elements, each element having an associated priority drawn from a totally ordered universe, under the operations Insert, which inserts an element into Q, and DeleteMin, which deletes an element with the minimum priority from Q. In this paper a priority-queue implementation is given which is efficient with respect to the number of block transfers or I/Os performed between the internal and external memories of a computer. Let B and M denote the respective capacity of a block and the internal memory measured in elements. The developed data structure handles any intermixed sequence of Insert and DeleteMin operations such that in every disjoint interval of B consecutive priorityqueue operations at most clogM/B N/M I/Os are performed, for some positive constant c. These I/Os are divided evenly among the operations: if B ≥ clogM/B N/M, one I/O is necessary for every B/(clogM/B N/M)th operation and if B < clogM/B N/M, c/B log M/B N/M I/Os are performed per every operation. Moreover, every operation requires O(log2 N) comparisons in the worst case. The best earlier solutions can only handle a sequence of S operations with O(σ Si=1 1/B log M/B Ni/M) I/Os, where N i denotes the number of elements stored in the data structure prior to the ith operation, without giving any guarantee for the performance of the individual operations.
The full version has appeared as Technical Report 97/25, Department of Computer Science, University of Copenhagen, Copenhagen, 1997.
Supported by the Carlsberg foundation under grant No. 96-0302/20. Partially supported by the ESPRIT Long Term Research Program of the EU under contract No. 20244 (project ALCOM-IT). Email: brodal@mpi-sb.mpg.de.
Supported partially by the Danish Natural Science Research Council under contract No. 9400952 (project Computational Algorithmics). Email: jyrki@diku.dk.
Preview
Unable to display preview. Download preview PDF.
References
G. M. Adel'son-Vel'skii and E. M. Landis. An algorithm for the organization of information. Soviet Mathematics, volume 3, pages 1259–1263, 1962.
A. Aggarwal and J. S. Vitter. The input/output complexity of sorting and related problems. Communications of the ACM, volume 31, pages 1116–1127, 1988.
A. V. Aho, J. E. Hopcroft, and J. D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley Publishing Company, Reading, 1974.
T.O. Alanko, H.H. A. Erkiö, and I. J. Haikala. Virtual memory behavior of some sorting algorithms. IEEE Transactions on Software Engineering, volume SE-10, pages 422–431, 1984.
L. Arge. The buffer tree: A new technique for optimal I/O-algorithms. In Proceedings of the 4th Workshop on Algorithms and Data Structures, Lecture Notes in Computer Science 955, Springer, Berlin/Heidelberg, pages 334–345, 1995.
L. Arge. Efficient external-memory data structures and applications. BRICS Dissertation DS-96-3, Department of Computer Science, University of Aarhus, århus, 1996.
L. Arge, P. Ferragina, R. Grossi, and J. S. Vitter. On sorting strings in external memory. In Proceedings of the 29th Annual ACM Symposium on Theory of Computing, ACM Press, New York, pages 540–548, 1997.
R. Bayer and E. M. McCreight. Organization and maintenance of large ordered indexes. Acta Informatica, volume 1, pages 173–189, 1972.
M. R. Brown. Implementation and analysis of binomial queue algorithms. SIAM Journal on Computing, volume 7, pages 298–319, 1978.
S. Carlsson, J.I. Munro, and P.V. Poblete. An implicit binomial queue with constant insertion time. In Proceedings of the 1st Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science 318, Springer-Verlag, Berlin/Heidelberg, pages 1–13, 1988.
D. Comer. The ubiquitous B-tree. ACM Computing Surveys, volume 11, pages 121–137, 1979.
C. A. Crane. Linear lists and priority queues as balanced trees. Technical Report STAN-CS-72-259, Computer Science Department, Stanford University, Stanford, 1972.
R. Fadel, K.V. Jakobsen, J. Katajainen, and J. Teuhola. Heaps and heapsort on secondary storage. To appear in Theoretical Computer Science.
M. J. Fischer and M. S. Paterson. Fishspear: A priority queue algorithm. Journal of the ACM, volume 41, pages 3–30, 1994.
G. A. Gibson, J. S. Vitter, J. Wilkes et al. Strategic directions in storage I/O issues in large-scale computing. ACM Computing Surveys, volume 28, pages 779–793, 1996.
L. J. Guibas and R. Sedgewick. A dichromatic framework for balanced trees. In Proceedings of the 19th Annual Symposium on Foundations of Computer Science, IEEE, New York, pages 8–21, 1978.
K. Harty and D.R. Cheriton. Application-controlled physical memory using external page-cache management. In Proceedings of the 5th International Conference on Architectural Support for Programming Languages and Operating Systems, ACM SIGPLAN Notices, volume 27, number 9, pages 187–197, 1992.
J. JáJá. An Introduction to Parallel Algorithms. Addison-Wesley Publishing Company, Reading, 1992.
B.H.H. Juurlink and H. A. G. Wijshoff. The parallel hierarchical memory model. In Proceedings of the 4th Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science 824, Springer-Verlag, Berlin/Heidelberg, pages 240–251, 1994.
D. E. Knuth. The Art of Computer Programming, volume 3/ Sorting and Searching. Addison-Wesley Publishing Company, Reading, 1973.
K. Krueger, D. Loftesness, A. Vahdat, and T. Anderson. Tools for the development of application-specific virtual memory management. In Proceedings of the 8th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, ACM SIGPLAN Notices, volume 28, number 10, pages 48–64, 1993.
A. LaMarca and R. E. Ladner. The influence of caches on the performance of heaps. The ACM Journal of Experimental Algorithmics, volume 1, article 4, 1996.
D. McNamee and K. Amstrong. Extending the Mach external pager interface to accommodate user-level block replacement policies. Technical Report 90-09-05, Department of Computer Science and Engineering, University of Washington, Seattle, 1990.
D. Naor, C. U. Martel, and N. S. Matloff. Performance of priority queue structures in a virtual memory environment. The Computer Journal, volume 34, pages 428–437, 1991.
M. H. Nodine and J. S. Vitter. Large-scale sorting in parallel memories. In Proceedings of the 3rd ACM Symposium on Parallel Algorithms and Architectures, ACM Press, New York, pages 29–39, 1991.
Y. N. Patt. Guest editor's introduction: The I/O subsystem — A candidate for improvement. IEEE Computer, volume 27, number 3, pages 15–16, 1994.
D. A. Patterson and J. L. Hennessy. Computer Organization & Design: The Hardware/Software Interface. Morgan Kaufmann Publishers, San Francisco, 1994.
R. Sedgewick. Algorithms. Addison-Wesley Publishing Company, Reading, 1983.
M. Thorup. On RAM priority queues. In Proceedings of the 7th Annual ACM-SIAM Symposium on Discrete Algorithms, ACM, New York and SIAM, Philadelphia, pages 59–67, 1996.
J. S. Vitter and E. A. M. Shriver. Algorithms for parallel memory I: Two-level memories. Algorithmica, volume 12, pages 110–147, 1994.
J. Vuillemin. A data structure for manipulating priority queues. Communications of the ACM, volume 21, pages 309–315, 1978.
L. M. Wegner and J. I. Teuhola. The external heapsort. IEEE Transactions on Software Engineering, volume 15, pages 917–925, 1989.
J. W. J. Williams. Algorithm 232, Heapsort. Communications of the ACM, volume 7, pages 347–348, 1964.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brodal, G.S., Katajainen, J. (1998). Worst-case efficient external-memory priority queues. In: Arnborg, S., Ivansson, L. (eds) Algorithm Theory — SWAT'98. SWAT 1998. Lecture Notes in Computer Science, vol 1432. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0054359
Download citation
DOI: https://doi.org/10.1007/BFb0054359
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64682-2
Online ISBN: 978-3-540-69106-8
eBook Packages: Springer Book Archive