This section covers two main Deque implementations: ArrayDeque and LinkedList, as shown in figure 4.20.
Let’s get started with class ArrayDeque. It’s a resizable array implementation of the Deque interface. Here’s a list of constructors of this class:
Let’s work with an example using the ArrayDeque constructor and other methods from this class:
Here’s the output of the preceding code:
D4 A1 B2 [B2, C3, E5, F6]