container.queue - Palamecia/mint GitHub Wiki

Module

load container.queue

This module provides the Container.Queue class which store objects and retrives them with the first in first out logic.

Packages

Classes

Container.Queue

This class create a queue based on a Container.LinkedList which stores a set of values.

A queue is a first in, first out (FIFO) structure. Elements are added to the tail of the queue using push and retrieved from the head using pop. The top function provides access to the head element without removing it.

Members

Modifiers Member Description
+ const isEmpty Returns true if the queue is empty; otherwise returns false.
+ const new Creates a new instance of Container.Queue. The created queue is empty.
+ const pop Removes the head element in the queue and returns it. This function assumes t...
+ const push Adds value to the tail of the queue.
+ const top Returns the queue's head element. This function assumes that the queue isn't ...
- final values Internal values representation.

Descriptions

Container.Queue.isEmpty

def (const self)

Returns true if the queue is empty; otherwise returns false.

Container.Queue.new

def (self)

Creates a new instance of Container.Queue. The created queue is empty.

Container.Queue.pop

def (self)

Removes the head element in the queue and returns it. This function assumes that the queue isn't empty.

Container.Queue.push

def (self, value)

Adds value to the tail of the queue.

Container.Queue.top

def (const self)

Returns the queue's head element. This function assumes that the queue isn't empty.

Container.Queue.values

null

Internal values representation.