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

    A deque is somewhat recursively defined: internally it maintains a double-ended queue of chunks of fixed size. . Each chunk is a vector, and the queue (“map” in the graphic below) of chunks …

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

    collections.deque is a collection, while Queue.Queue is a communications mechanism. The overhead in Queue.Queue is to make it threadsafe. Using deque for communicating between …

  3. Newest 'deque' Questions - Stack Overflow

    Dec 13, 2024 · I've been reading gcc 13537 bug report about std::deque push_back, push_front operations, and how they are really amortized O(1), instead of just O(1). The discussion end …

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

    Feb 12, 2015 · It appears that the way deque is usually implemented is a variable size array of fixed size arrays. This makes growing faster than a vector (which requires reallocation and …

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

    Oct 11, 2018 · A deque is a set of linked memory blocks, where more than one element is stored in each memory block. A list is a set of elements dispersed in memory, i.e.: only one element …

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

    Mar 18, 2011 · If you don't actually need all of the features of deque, use a vector. On the other hand, sometimes you do need features which vector does not give you, in which case you …

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

    May 21, 2017 · Instead, they use some other container (e.g. std::deque or std::list to actually store the data), and the std::stack class just has a tiny bit of code to translate push and pop to …

  8. How are deques in Python implemented, and when are they worse …

    Dec 10, 2015 · @senderle: Of course, the list pops were slower than deque's (likely due to list's higher cost of intermittently resizing as it shrinks, where deque is just freeing blocks back to …

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

    Jul 31, 2016 · To make it act like a queue, use the popleft() command. Deques are made to support both behaviors, and this way the pop() function is consistent across data structures. In …

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

    May 13, 2021 · "AttributeError: collections.deque has no attribute length" Then the reason is that you probably used JavaScript syntax in Python, i.e. you tried to call. from collections import …

Refresh