Skip to content

Stack

class Stack<Type> < Object

Stack.

Member Functions

Name Description
size Number of elements.
empty Is this empty?
clear Clear all elements.
top Get the top element.
push Push an element onto the top.
pop Pop an element from the top.

Member Function Details

clear

function clear()

Clear all elements.

empty

function empty() -> Boolean

Is this empty?

pop

function pop()

Pop an element from the top.

push

function push(x:Type)

Push an element onto the top.

  • x: the element.

size

function size() -> Integer

Number of elements.

top

function top() -> Type

Get the top element.