Complete the code to create a new Deque instance.
Deque<Integer> deque = new [1]<>();The LinkedList class implements the Deque interface in Java, allowing double-ended queue operations.
Complete the code to add element 10 to the front of the deque.
deque.[1](10);
addFirst adds an element to the front (head) of the deque.
Fix the error in the code to remove the last element from the deque.
int last = deque.[1]();removeLast removes and returns the last element of the deque.
Fill both blanks to check if the deque is empty and then add element 5 to the end.
if (deque.[1]()) { deque.[2](5); }
isEmpty() checks if the deque has no elements, and addLast(5) adds 5 to the end.
Fill all three blanks to create a deque, add 1 to front, add 2 to end, then remove from front.
Deque<Integer> dq = new [1]<>(); dq.[2](1); dq.[3](2); dq.removeFirst();
ArrayDeque is a fast implementation of Deque. addFirst(1) adds 1 to front, addLast(2) adds 2 to end.
