About 7,120,000 results
Open links in new tab
  1. c++ - What really is a deque in STL? - Stack Overflow

    A deque, short for "double-ended queue," is a versatile data structure in the C++ Standard Template Library (STL). It allows for efficient insertion and deletion of elements at both the …

  2. python - queue.Queue vs. collections.deque - Stack Overflow

    I need a queue which multiple threads can put stuff into, and multiple threads may read from. Python has at least two queue classes, queue.Queue and collections.deque, with the former …

  3. Why does std::stack use std::deque by default?

    Feb 12, 2015 · Updated based on the Answers below: It appears that the way deque is usually implemented is a variable size array of fixed size arrays. This makes growing faster than a …

  4. Newest 'deque' Questions - Stack Overflow

    Sep 9, 2024 · 3answers 154views Does a deque maintain its capacity even if emptied completely? I wanted to test if a deque<> does free its chunks if it is completely emptied: …

  5. What's the difference between deque and list STL containers?

    Oct 11, 2018 · Deque: Any insertion or deletion of elements other than at the beginning or end invalidates all pointers, references, and iterators that refer to elements of the deque. List: …

  6. Why would I prefer using vector to deque - Stack Overflow

    Mar 18, 2011 · Since: (I presume) they are both contiguous memory containers; feature wise, deque has almost everything vector has but more, since it is more efficient to insert in the …

  7. How to check deque length in Python - Stack Overflow

    May 13, 2021 · @memo: read the question body. collections.deque is different from queue.Queue. The latter is expected to be used in a multithreading case where the size may …

  8. queue - How Does Deque Work in Python - Stack Overflow

    Jul 31, 2016 · A deque is a generalization of stack and a queue (It is short for "double-ended queue"). Thus, the pop () operation still causes it to act like a stack, just as it would have as a …

  9. c++ - deque::insert () at index? - Stack Overflow

    Oct 22, 2011 · 7 There is a deque::insert(iterator pos, const T&x) function taking the position pos as deque::iterator and a single element. Using this method you could insert all elements one …

  10. containers - c++ deque vs queue vs stack - Stack Overflow

    May 21, 2017 · In deque (double-ended queue) The element can be inserted from the back and removed from the rear (like in stack), but queue only allows removal from the front.

Refresh