What elements does the deque contain

Report a typo

Here's a code with a deque:

Deque<Integer> deq = new LinkedList<>();
deq.offerFirst(10);
deq.peekFirst();
deq.offerFirst(20);
deq.offerLast(30);
deq.peekLast();
deq.pollFirst();
deq.offerLast(40);

What elements does the deque contain after executing the code above?

Enter all values from left (the first) to right (the last) separated by spaces

Enter a short text
___

Create a free account to access the full topic