Skip to main content

Experiences with the Design and Implementation of Space-Efficient Deques

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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.

    Chapter  Google 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 

  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. M. H. Overmars, The Design of Dynamic Data Structures, Lecture Notes in Computer Science 156, Springer-Verlag, Berlin/Heidelberg, Germany (1983).

    MATH  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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics