MPS 2019.2 Help

Queue

A simple queue abstraction, backed by linked list or priority queue.

Queue type

queue<Type>

Subtypes

Supertypes

Comparable types

deque<Type>

sequence<Type>

java.util.Deque<Type>

Queue creation

new linkedlist
new priority_queue

Parameter type

Result type

Type...
sequence<? extends Type>

queue<Type>

Creates an empty queue. 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 queue

iterator

Operand type

Parameter type

Result type

sequence<Type>

none

modifying_iterator<Type>

This operation is redefined for queue to return a modifying_iterator .

addLast

Operand type

Parameter type

Result type

queue<Type>

Type

Type

Appends an element to the tail of the queue.

ast (value);

removeFirst

Operand type

Parameter type

Result type

queue<Type>

 

Type

Removes an element from the head of the queue.

veFirst (value);

first

Operand type

Parameter type

Result type

queue<Type>

 

Type

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

t ();

last

Operand type

Parameter type

Result type

queue<Type>

 

Type

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

t ();
Last modified: 30 August 2019