container.stack - Palamecia/mint GitHub Wiki

Module

load container.stack

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

Packages

Classes

Container.Stack

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

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

Members

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

Descriptions

Container.Stack.isEmpty

def (const self)

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

Container.Stack.new

def (self)

Creates a new instance of Container.Stack. The created stack is empty.

Container.Stack.pop

def (self)

Removes the top element from the stack and returns it. This function assumes that the stack isn't empty.

Container.Stack.push

def (self, value)

Adds value to the top of the stack.

Container.Stack.top

def (const self)

Returns the stack's top element. This function assumes that the stack isn't empty.

Container.Stack.values

null

Internal values representation.