types/collections/queue.ql
Function | Description |
---|---|
static fun fromList(list) | Creates a new queue from a list of elements. |
fun enqueue(element) | Enqueues an element onto the queue. |
fun dequeue() | Dequeues an element from the queue. |
fun peek() | Peeks at the front element of the queue. |
fun isEmpty() | Checks if the queue is empty. |
fun size() | Gets the size of the queue. |
fun toList() | Converts the queue to a list. |
Field | Description |
---|---|
any _queue |
Enqueues an element onto the queue.
element
|
The element to enqueue onto the queue |
Dequeues an element from the queue.
The element dequeued from the queue
If the queue is empty
Peeks at the front element of the queue.
The front element of the queue
If the queue is empty