Array Deque
Resizable-array implementation of the deque data structure.
The name deque is short for "double ended queue" and is usually pronounced "deck".
The collection provide methods for convenient access to the both ends. It also implements MutableList interface and supports efficient get/set operations by index.
Since Kotlin
Constructors
Constructs an empty deque with specified initialCapacity, or throws IllegalArgumentException if initialCapacity is negative.
Constructs an empty deque.
Constructs a deque that contains the same elements as the specified elements collection in the same order.
Functions
Returns the first element, or throws NoSuchElementException if this deque is empty.
Returns the first element, or null
if this deque is empty.
Returns the last element, or throws NoSuchElementException if this deque is empty.
Returns the last element, or null
if this deque is empty.
Removes the first element from this deque and returns that removed element, or throws NoSuchElementException if this deque is empty.
Removes the first element from this deque and returns that removed element, or returns null
if this deque is empty.
Removes the last element from this deque and returns that removed element, or throws NoSuchElementException if this deque is empty.
Removes the last element from this deque and returns that removed element, or returns null
if this deque is empty.