MPS 2019.2 Help

Deque

A simple double-linked queue abstraction, backed by linked list.

Deque type

queue<Type>

Subtypes

Supertypes

Comparable types

 

sequence<Type>
queue<Type>
stack<Type>

java.util.Deque<Type>

Deque creation

new linkedlist

Parameter type

Result type

Type...
sequence<? extends Type>

deque<Type>

Creates an empty deque. Optionally, initial values may be specified right in the new linked list creation expression.

ring> test = new linkedlist<string> {"A", "B", "C"};


Alternatively, a sequence may be specified that is used to copy elements from.

pe> = new linkedlist<Type> (sequence);

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.

irst (value);

addLast

Operand type

Parameter type

Result type

deque<Type>

Type

Type

Appends an element to the tail of the deque.

ast (value);

removeFirst / pop

Operand type

Parameter type

Result type

deque<Type>

 

Type

Removes an element from the head of the deque.

veFirst (value);

first

Operand type

Parameter type

Result type

queue<Type>

 

Type

Retrieves the first element at the head of the deque without removing it.

t ();

last

Operand type

Parameter type

Result type

queue<Type>

 

Type

Retrieves the first element at the tail of the deque without removing it.

t ();
Last modified: 30 August 2019