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)
- How do I “decompile” Java class files? [closed]
- How do I compare strings in Java?
- Is Java “pass-by-reference” or “pass-by-value”?
- Could not reserve enough space for object heap
- How to get current timestamp in string format in Java? “yyyy.MM.dd.HH.mm.ss”
- What is null in Java?
- What is an illegal reflective access?
- Convert Set to List without creating new List
- MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser
- Can I catch multiple Java exceptions in the same catch clause?
- How to get the current date/time in Java
- What is the use of printStackTrace() method in Java?
- How do I limit the number of decimals printed for a double?
- Please initialize the log4j system properly warning
- How to convert jsonString to JSONObject in Java
- how to iterate in List
- > in java and set their values as we do in a normal int a[i][j] matrix type [duplicate]
- java.lang.NullPointerException: Attempt to invoke virtual method on a null object reference
- Java – Best way to print 2D array?
- Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
- How to update a value, given a key in a hashmap?
- How to schedule a periodic task in Java?
- Convert array of strings into a string in Java
- What is Serialization?
- SSL and cert keystore
- What’s the difference between import java.util.*; and import java.util.stream;?
- How do I efficiently iterate over each entry in a Java Map?
- Collections sort(List
,Comparator super T>) method example - Why nextLine() and not nextString() ?
- Very Basic Java
- What is the meaning of “%d:%02d” in `printf`?
- Calculate average in java
- Type List vs type ArrayList in Java
- Maven error : Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
- How do I escape a single quote in jQuery?
- Polymorphism vs Overriding vs Overloading
- How to pause my Java program for 2 seconds
- How to convert a byte array to a hex string in Java?
- How to get the last value of an ArrayList
- ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”
- How to check if the value is integer in java?
- Java Error: Invalid top level statement
- How to make an array of arrays in Java
- A fatal error has been detected by the Java Runtime Environment. EXCEPTION_ACCESS_VIOLATION
- Instantiating object of type parameter
- how to make jni.h be found?
- What is the best open-source java charting library? (other than jfreechart)
- difference between System.out.println() and System.err.println()
- Selenium — How to wait until page is completely loaded
- Cannot resolve symbol ‘button’ -Android Studio
- Checking to see if array is full
- Tomcat 404 error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists
- “The import org.springframework cannot be resolved.”
- How to synchronize or lock upon variables in Java?
- Any shortcut to initialize all array elements to zero?
- Simple HTTP server in Java using only Java SE API
- make a JLabel wrap it’s text by setting a max width
- incompatible types: void cannot be converted to int [duplicate]
- Long cannot be dereferenced
- Align printf output in Java
- How to write logs in text file when using java.util.logging.Logger
- Java Memcached Client
- How to enable the Java keyword assert in Eclipse program-wise?
- Map of maps – how to keep the inner maps as maps?
- method does not override or implement a method from a supertype – for Override
- Hibernate show real SQL
- How can I set size of a button?
- Error message ‘Cannot be resolved or is not a field’