Search This Blog

Total Pageviews

What is Deque in Java?

  • Deque is Double ended queue.
  • Supports element insertion and deletion at both ends.
  • Deques can also be used as LIFO (Last-In-First-Out)
  • When a Deque is used as a stack, elements are pushed and popped from the beginning of the
  • deque
Example Implementation:
ArrayDeque<String> deque = new ArrayDeque<String>();
for (Iterator<String> element = deque.iterator(); iter.hasNext(); ) { System.out.println(element.next()); }

Application Ideas:

- To implement Undo-Redo Operations
- To implement Steal Job scheduling Algorithm.

No comments:

gradlew : The term 'gradlew' is not recognized as the name of a cmdlet, function, script file , or operable program

The command gradlew was not found, but does exist in the current location.  Windows PowerShell does not load commands from the current locat...