Deque is short for “double ended queue”. With an ordinary queue, you add things to one end and take them from the other. With a double ended queue, you can add things to either end, and take them from either end. That makes it a bit more versatile; for example, you could use it as a stack if you wanted to.
In terms of efficiency, it really depends on the implementation. But generally speaking, you wouldn’t expect a deque to outperform a queue, because a (single ended) queue could be implemented in a way that doesn’t allow objects to be added or removed at the “wrong” end. Whereas any implementation of a deque would also work as an implementation of a queue.
Related Posts:
- How do I instantiate a Queue object in java?
- Does Java support structs?
- Does Java support structs?
- Library for the Basic Data Structures, such as Queue, in C
- Search for words with telephone numbers from 2-3-4 tree
- How can I implement a tree in Python?
- JavaScript hashmap equivalent
- Is there an easy way to make a min heap in C++?
- Difference between binary tree and binary search tree
- How to implement a tree data-structure in Java?
- Explanation of runtimes of BFS and DFS
- Array versus linked-list
- A proper way to create a matrix in c++
- Java implementation for Min-Max Heap?
- Why does the C++ STL not provide any “tree” containers?
- What do I use for a max-heap implementation in Python?
- Minimum Spanning Tree: What exactly is the Cut Property?
- FIFO based Queue implementations?
- HashMap get/put complexity
- Quick Way to Implement Dictionary in C
- How does a hash table work?
- What is the difference between a map and a dictionary?
- Cannot instantiate the type Queue. Why is this?
- Linked List vs Vector
- Difference between a HashMap and a dictionary ADT
- Enqueue, Dequeue and ViewQueue in Java
- Implementing a HashMap in C
- Why lookup in a Binary Search Tree is O(log(n))?
- What is the difference between an Abstract Data Type(ADT) and a Data Structure?
- Get keys from HashMap in Java
- Chained Hash Tables vs. Open-Addressed Hash Tables
- How to print binary tree diagram in Java?
- Big O Complexity in Binary Search Tree(BST)
- What does Java option -Xmx stand for? [duplicate]
- How do I convert a String to an int in Java?
- What does Java option -Xmx stand for? [duplicate]
- Is there an invisible character that is not regarded as whitespace?
- Problem with gif with transparent background
- Finding white rectangle in an image
- 1000 * 60 * 60 * 24 * 30 results in a negative number [duplicate]
- What is the difference between Python’s list methods append and extend?
- How to convert nanoseconds to seconds using the TimeUnit enum?
- Using or ‘|’ in regex [duplicate]
- How to format strings in Java
- What is the difference between x86 and x64
- && (AND) and || (OR) in IF statements
- How to use the toString method in Java?
- What is a NullPointerException, and how do I fix it?
- What exactly is Apache Camel?
- Unable to find valid certification path to requested target – error even after cert imported
- Unable to find valid certification path to requested target – error even after cert imported
- What is the equivalent of the C++ Pair
in Java? - Java – Convert integer to string [duplicate]
- Getting random numbers in Java [duplicate]
- What is an instance variable in Java?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Java: “error: cannot find symbol”
- How does the Java ‘for each’ loop work?
- Which is the difference between Long.valueOf(0) and 0L in Java?
- What is a StackOverflowError?
- What are the differences between a HashMap and a Hashtable in Java?
- Use of “instanceof” in Java [duplicate]
- How to use Collections.sort() in Java?
- How to uninstall Eclipse?
- Is GNU’s Java Compiler (GCJ) dead? [closed]
- How does System.out.print() work?
- How do I “decompile” Java class files? [closed]
- How do I determine whether an array contains a particular value in Java?
- How to initialize an array in Java?
- How does the Java ‘for each’ loop work?
- Java 8 Iterable.forEach() vs foreach loop
- Initialize part of an array in java
- How can I solve Exception in thread “main” java.lang.NullPointerException error [duplicate]
- How to split a string in Java
- What does “Could not find or load main class” mean?
- What does “Could not find or load main class” mean?
- Why am I getting a NoClassDefFoundError in Java?
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- Eclipse/Maven error: “No compiler is provided in this environment”
- How do I compare strings in Java?
- Is Java “pass-by-reference” or “pass-by-value”?
- What is reflection and why is it useful?
- Implementing UML diagram to Java [closed]
- How to round a number to n decimal places in Java
- Using Pairs or 2-tuples in Java [duplicate]
- How do I create a file and write to it?
- Could not reserve enough space for object heap
- Difference between java.exe and javaw.exe
- When to use LinkedList over ArrayList in Java?
- Can’t start Eclipse – Java was started but returned exit code=13
- How to convert a char to a String?
- Can’t start Eclipse – Java was started but returned exit code=13
- super() in Java
- Difference between Arrays.asList(array) and new ArrayList
(Arrays.asList(array)) - What is the proper way to handle a NumberFormatException when it is expected?
- What causes “Unable to access jarfile” error?
- What does “Could not find or load main class” mean?
- How do you create a dictionary in Java? [closed]
- Reading a plain text file in Java