Abstract
A new realization of a space-efficient deque is presented. The data structure is constructed from three singly resizable arrays, each of which is a blockwise-allocated pile (a heap without the order property). The data structure is easily explainable provided that one knows the classical heap concept. All core deque operations are performed in O(1) worst-case time. Also, general modifying operations are provided which run in O(√n) time if the structure contains n elements. Experiences with an implementation of the data structure show that, compared to an existing library implementation, the constants for some of the operations are unfavourably high, whereas others show improved running times.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
J. Bentley, Programming Pearls, 2nd Edition, Addison-Wesley, Reading, Massachusetts (2000).
J. Bojesen, Heap implementations and variations, Written Project, Department of Computing, University of Copenhagen, Copenhagen, Denmark (1998). Available at http://www.diku.dk/research-groups/performance-engineering/resources.html .
A. Brodnik, S. Carlsson, E. D. Demaine, J.I. Munro, AND R. Sedgewick, Resizable arrays in optimal time and space, Proceedings of the 6th International Workshop on Algorithms and Data Structures, Lecture Notes in Computer Science 1663, Springer-Verlag, Berlin/Heidelberg, Germany (1999), 37–48.
A. Brodnik, S. Carlsson, E. D. Demaine, J.I. Munro, AND R. Sedgewick, Resizable arrays in optimal time and space, Technical Report CS-99-09, Department of Computer Science, University of Waterloo, Waterloo, Canada (1999). Available at ftp://cs-archive.uwaterloo.ca/cs-archive/CS-99-09/
Department of Computing, University of Copenhagen, The Copenhagen STL, Website accessible at http://cphstl.dk/ (2000–2001).
M. T. Goodrich AND J. G. Kloss II, Tiered vectors: Efficient dynamic arrays for rank-based sequences, Proceedings of the 6th International Workshop on Algorithms and Data Structures, Lecture Notes in Computer Science 1663, Springer-Verlag, Berlin/Heidelberg, Germany (1999), 205–216.
ISO (THE INTERNATIONAL ORGANIZATION FOR TANDARDIZATION) AND IEC (THE INTERNATIONAL ELECTROTECHNICAL COMMISSION), International Standard ISO/IEC 14882: Programming Languages — C++, Genéve, Switzerland (1998).
B. B. Mortensen, The deque class in the Copenhagen STL: First attempt, Copenhagen STL Report 2001-4, Department of Computing, University of Copenhagen, Copenhagen, Denmark (2001). Available at http://cphstl.dk/.
M. H. Overmars, The Design of Dynamic Data Structures, Lecture Notes in Computer Science 156, Springer-Verlag, Berlin/Heidelberg, Germany (1983).
P. J. Plauger, A. A. Stepanov, M. Lee, AND D.R. Musser, The C++ Standard Template Library, Prentice Hall PTR, Upper Saddle River, New Jersey (2001).
Silicon Graphics, INC., Standard template library programmerℰss guide, Worldwide Web Document (1990–2001). Available at http://www.sgi.com/tech/stl/.
B. Stroustrup, The C++ Programming Language, 3rd Edition, Addison-Wesley Publishing Company, Reading, Massachusetts (1997).
H. Sutter, Standard library news, part 1: Vectors and deques, C++ Report 11,7 (1999). Available at http://www.gotw.ca/publications/index.htm.
J. W. J. Williams, Algorithm 232: Heapsort, Communications of the ACM 7 (1964), 347–348.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Katajainen, J., Mortensen, B.B. (2001). Experiences with the Design and Implementation of Space-Efficient Deques. In: Brodal, G.S., Frigioni, D., Marchetti-Spaccamela, A. (eds) Algorithm Engineering. WAE 2001. Lecture Notes in Computer Science, vol 2141. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44688-5_4
Download citation
DOI: https://doi.org/10.1007/3-540-44688-5_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42500-7
Online ISBN: 978-3-540-44688-0
eBook Packages: Springer Book Archive