Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

deque in java

Deque<Integer> arrayQueue = new ArrayDeque<>();
Deque<Integer> linkedListQueue = new LinkedList<>();

// these operations are useful and same on both.
arrayQueue.push()/addFirst()/addLast();

arrayQueue.remove()/removeFirst()/removeLast()/pop();

arrayQueue.peek()/peekFirst()/peekLast()/size()/
 
PREVIOUS NEXT
Tagged: #deque #java
ADD COMMENT
Topic
Name
5+7 =