deque

This is a discussion on deque within the C++ Programming forums, part of the General Programming Boards category; Hello everyone, I want to learn more about deque, and previously I only have basic concept and samples about deque ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    deque

    Hello everyone,


    I want to learn more about deque, and previously I only have basic concept and samples about deque as a double-ended queue.

    My questions are,

    1. How it is implemented internally for the performance optimization for get front and end elements? Elements are stored in an array or linked list or?
    2. Are there any documents about how to use deque effectively and efficiently (i.e. good patterns and anti-patterns of deque)? I have searched MSDN and Google and only found some sample samples. Any experience sharing or recommended articles?


    thanks in advance,
    George

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,159
    This has been answered elsewhere.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    Quote Originally Posted by George2 View Post
    Hello everyone,


    I want to learn more about deque, and previously I only have basic concept and samples about deque as a double-ended queue.

    My questions are,

    1. How it is implemented internally for the performance optimization for get front and end elements? Elements are stored in an array or linked list or?
    2. Are there any documents about how to use deque effectively and efficiently (i.e. good patterns and anti-patterns of deque)? I have searched MSDN and Google and only found some sample samples. Any experience sharing or recommended articles?


    thanks in advance,
    George
    There are dozens of ways of implementing a deque. List, vector, vector of vectors etc etc.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks iMalc,


    Quote Originally Posted by iMalc View Post
    There are dozens of ways of implementing a deque. List, vector, vector of vectors etc etc.
    What is your understanding of the statements from The C++ Standard Library book when compare vector with deque? Why one more indirection level?

    --------------------
    The internal structure has one more indirection to access the elements, so element access and iterator movement of deques are usually a bit slower.
    --------------------


    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. deque best practices
    By George2 in forum C++ Programming
    Replies: 10
    Last Post: 03-02-2008, 08:11 PM
  2. Using DEQUE within Class Definition
    By wbeasl in forum C++ Programming
    Replies: 8
    Last Post: 10-07-2007, 10:50 AM
  3. Confusion with a Deque program
    By Bluefish in forum C++ Programming
    Replies: 0
    Last Post: 05-20-2006, 04:13 PM
  4. costum grow() not working
    By Opel_Corsa in forum C++ Programming
    Replies: 2
    Last Post: 02-17-2006, 10:11 PM
  5. Very slow processing of vectors?
    By Blackroot in forum C++ Programming
    Replies: 35
    Last Post: 02-06-2006, 06:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21