About 51 results
Open links in new tab
  1. 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 seemingly usi...

  2. 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 front and back ends.

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

    May 13, 2021 · How to check the length of this deque? and can we initialize like

  4. Using std::copy to copy into an std::deque - Stack Overflow

    You don't need std::copy to do this with std::deque. std::deque has member function std::deque::insert and you could append a range to it in the following manner:

  5. Java adding to the front of queue - deque - Stack Overflow

    this is my first question here and I hope everyone is well. I had to code an array implementation of a deque or a double ended queue but was having some trouble understanding the enqueue element t...

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

    Aug 29, 2015 · 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.

  7. Deque - how come "reserve" doesn't exist? - Stack Overflow

    Mar 20, 2013 · The standard STL vector container has a "reserve" function to reserve uninitialized memory that can be used later to prevent reallocations. How come that the other deque container …

  8. list.pop() and deque.pop() -- is there a performance difference?

    Aug 10, 2019 · Well, first off, it's called pop for both list and deque, there is no popright method on deque s. There is usually no meaningful performance difference between the two; every once in a …

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

    Sep 14, 2024 · 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 front. Why would …

  10. Iterate over deque in python - Stack Overflow

    Since a deque is a doubly linked list, I should be able to iterate through it in order without any performance cost compared to a list. However, the following will be much slower than iterating thr...