class

Graphlb::DataStructures::Stack(A)

Inherits Reference / Object

A stack Data Structure formed using an Array A stack follows Last-in-First-out

Constructors

new

Initializes the stack with empty

Source

Instance methods

empty?

returns true if the stack is empty

Source
pop

pops the value that is last inserted

Source
push(val)

pushes the value present inside the val into the stack

Source
top

returns the top-most element in the stack

Source
values

returns all the values that are present in the stack

Source