Experiences with the Design and Implementation of Space-Efficient Deques
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.
KeywordsData Block Sequence Operation Order Property Extra Space Reorganization Process
Unable to display preview. Download preview PDF.
- 1.J. Bentley, Programming Pearls, 2nd Edition, Addison-Wesley, Reading, Massachusetts (2000).Google Scholar
- 2.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.
- 3.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.Google Scholar
- 4.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/
- 5.Department of Computing, University of Copenhagen, The Copenhagen STL, Website accessible at http://cphstl.dk/ (2000–2001).
- 6.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.CrossRefGoogle Scholar
- 7.ISO (THE INTERNATIONAL ORGANIZATION FOR TANDARDIZATION) AND IEC (THE INTERNATIONAL ELECTROTECHNICAL COMMISSION), International Standard ISO/IEC 14882: Programming Languages — C++, Genéve, Switzerland (1998).Google Scholar
- 10.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).Google Scholar
- 11.Silicon Graphics, INC., Standard template library programmerℰss guide, Worldwide Web Document (1990–2001). Available at http://www.sgi.com/tech/stl/.
- 12.B. Stroustrup, The C++ Programming Language, 3rd Edition, Addison-Wesley Publishing Company, Reading, Massachusetts (1997).Google Scholar
- 13.H. Sutter, Standard library news, part 1: Vectors and deques, C++ Report 11,7 (1999). Available at http://www.gotw.ca/publications/index.htm.
- 14.J. W. J. Williams, Algorithm 232: Heapsort, Communications of the ACM 7 (1964), 347–348.Google Scholar