class Graphlb::DataStructures::Stack(A)

Overview

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

Defined in:

graphlb/data_structures/stack.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

Initializes the stack with empty


[View source]

Instance Method Detail

def empty? #

returns true if the stack is empty


[View source]
def pop #

pops the value that is last inserted


[View source]
def push(val) #

pushes the value present inside the val into the stack


[View source]
def top #

returns the top-most element in the stack


[View source]
def values #

returns all the values that are present in the stack


[View source]