Complete deque.java