A double-ended queue. Container datatype which is typically supporting efficient insertion and removal from two ends.
Questions tagged [deque]
993 questions
-3
votes
2 answers
Dynamic allocation and random access: Raw, Smart, Deque, Vector. Why raw so fast, and deque so slow?
I created a little performance test comparing the setup and access times of three popular techniques for dynamic allocation: raw pointer, std::unique_ptr, and a std::deque.
EDIT: per @NathanOliver's, added std::vector:
EDIT 2: per latedeveloper's,…

kmiklas
- 13,085
- 22
- 67
- 103
-3
votes
1 answer
How to define Dequeue methods to add and remove elements from rear and front?
Here is my code where I'm attempting to create code for methods that will act as the deque in java
I have the methods as follows:
void deque();
void addFront();
void addRear();
void RemoveFront();
void RemoveRear();
void isempty();
void…

user5232297
- 1
- 2
-3
votes
1 answer
Creating my own Deque Interface and Deque Class
So I've created a Deque interface, but I'm not sure how I go about instantiating my Deque, I thought to use ArrayDeque, but I believe that ArrayDeque is another Interface, and I'm trying to use my own Interface.
public interface DequeInterface {
…

Aman Kakkar
- 51
- 1
- 8
-3
votes
1 answer
C++ "deque iterator not dereferencable"
I'm trying to write a program which simulates airport operation using a deque and keep running into a "deque iterator not dereferencable error. After searching the error it says this is usually caused by trying to pop from an empty queue, but I have…
-3
votes
1 answer
Confusing syntax of deque. What does this syntax mean?
I have a C++ code for deque which declares the deque and I do not understand what it means?
deque pile[7];
The above deque used is from standard library implementation of C++
I did an extensive research on it but no body has used it this way.…

The-Rohan D. Shah
- 67
- 1
- 3
- 8
-3
votes
2 answers
Include deque in C
I have troubles to include deque in my C code. I thought that deque should be a standard library, but when I am trying to include it with #include the compiler's answer is: No such file or directory.
I was searching for header in files given…

Zuz
- 9
- 2
-3
votes
3 answers
Push back numbers in a deque in c++
I've got a deque in c++ and I want to push back to it numbers from 1 to 17. I wrote the following code:
string Result;
string Result;
ostringstream convert;
for(int i=1; i< 18; i++){
convert >> i;
Result =…

snake plissken
- 2,649
- 10
- 43
- 64
-4
votes
1 answer
What are the possible applications of deque functions in real time use?
Help me learn with the application of real time use of deque functions from collection library, if possible try adding some examples to it .
Thank You.

Toshith
- 1
- 2
-4
votes
1 answer
Java check for increment/decrement pattern
my question/issue (Both really) is I want to check for a increment pattern in Java via a list.
What I mean basically is lets say I have a list of 10 samples worth of floats (Or doubles, or whantnot) with the following values:
3.2675781, 3.2800293,…

Clysic
- 25
- 9
-4
votes
1 answer
Size of nested deques
I want to get the size of a nested deque, like this one:
typedef struct{
deque vec1;
deque vec2;
deque vec3;
}struct_deques;
deque nestedVecs;
However, when I want to access the size of the first deque, after…

Firas94
- 1
- 1
-4
votes
1 answer
Why won't my C, Circular Deque program exit the print function?
I am doing a Circular Linked List Deque assignment in C. The code runs fine and the outputs are as expected, but for some reason after the circularListReverse()
void circularListReverse(struct CircularList* list)
{
…

antman1p
- 514
- 2
- 11
- 25
-4
votes
2 answers
I wish to return the value a deque entry. Why is it of type "Void"?
I have create a deque below in a class myClass{}:
std:dequemyDeque;
I create a UINT8 pointer
UINT8* up = new rx[20];
I push it on:
myDeque.push_back(up);
Now in sum function I wish to return an entry:
UINT8* myClass::somefuntion()
{
…

Michael Murdock
- 129
- 1
- 9
-4
votes
1 answer
Invalid deque subscript . Why am I getting this error?
I am getting the execption error in the following piece of code. Any suggestions on what might be causing it ?
Error : Invalid deque subscript
typedef boost::shared_ptr shared_hist_def;
typedef std::deque…

MistyD
- 16,373
- 40
- 138
- 240
-5
votes
1 answer
C++ Vector Front
I'm having trouble with the getFirst() functions , they're supposed to return the first element of the deque / vector but instead they return fixed values like 45 or 69!
For example: I Add(0xFB) ... then try to…

NT_SYSTEM
- 367
- 1
- 6
- 14
-5
votes
2 answers
What is the Big O of deque data structure in c++?
What is the Big O of deque data structure in c++?
And how it really implemented!
I didn't Found the answer anywhere.

Ahmed Abdou
- 1
- 1