Deque
Deque
A simple double-linked queue abstraction, backed by linked list.
Deque type
queue<Type>
| Subtypes | Supertypes | Comparable types |
|---|---|---|
|
| sequence<Type> | java.util.Deque<Type> |
Deque creation
new linkedlist| Parameter type | Result type |
|---|---|
| Type... | deque<Type> |
Creates an empty deque. Optionally, initial values may be specified right in the new linked list creation expression.
Alternatively, a sequence may be specified that is used to copy elements from.
Operations on deque
iterator
| Operand type | Parameter type | Result type |
|---|---|---|
| sequence<Type> | none | modifying_iterator<Type> |
This operation is redefined for deque to return a modifying_iterator .
addFirst / push
| Operand type | Parameter type | Result type |
|---|---|---|
| deque<Type> | Type | Type |
Appends an element to the head of the deque.
addLast
| Operand type | Parameter type | Result type |
|---|---|---|
| deque<Type> | Type | Type |
Appends an element to the tail of the deque.
removeFirst / pop
| Operand type | Parameter type | Result type |
|---|---|---|
| deque<Type> |
| Type |
Removes an element from the head of the deque.
first
| Operand type | Parameter type | Result type |
|---|---|---|
| queue<Type> |
| Type |
Retrieves the first element at the head of the deque without removing it.
last
| Operand type | Parameter type | Result type |
|---|---|---|
| queue<Type> |
| Type |
Retrieves the first element at the tail of the deque without removing it.