Advertisement

Experiences with the Design and Implementation of Space-Efficient Deques

  • Jyrki Katajainen
  • Bjarke Buur Mortensen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2141)

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.

Keywords

Data Block Sequence Operation Order Property Extra Space Reorganization Process 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    J. Bentley, Programming Pearls, 2nd Edition, Addison-Wesley, Reading, Massachusetts (2000).Google Scholar
  2. 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. 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. 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. 5.
    Department of Computing, University of Copenhagen, The Copenhagen STL, Website accessible at http://cphstl.dk/ (2000–2001).
  6. 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. 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
  8. 8.
    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/.Google Scholar
  9. 9.
    M. H. Overmars, The Design of Dynamic Data Structures, Lecture Notes in Computer Science 156, Springer-Verlag, Berlin/Heidelberg, Germany (1983).zbMATHGoogle Scholar
  10. 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. 11.
    Silicon Graphics, INC., Standard template library programmerℰss guide, Worldwide Web Document (1990–2001). Available at http://www.sgi.com/tech/stl/.
  12. 12.
    B. Stroustrup, The C++ Programming Language, 3rd Edition, Addison-Wesley Publishing Company, Reading, Massachusetts (1997).Google Scholar
  13. 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. 14.
    J. W. J. Williams, Algorithm 232: Heapsort, Communications of the ACM 7 (1964), 347–348.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Jyrki Katajainen
    • 1
  • Bjarke Buur Mortensen
    • 1
  1. 1.Department of ComputingUniversity of CopenhagenCopenhagen EastDenmark

Personalised recommendations