CreateStack


stack = CreateStack({copyStack})

This function returns an object reference that points to a stack. An existing stack may be copied by placing it as the optional parameter copyStack.

A stack is a kind of collection in which elements put in first will be the last removed forming a Last-In-First-Out (LIFO) data structure.


stack = CreateStack()

n = 1
put stack, n ' Push

1



n = 2
put stack, n ' Push

1

2



n = 3
put stack, n ' Push

1

2

3



get stack, a ' Peek

1

2

3

a = 3


remove stack, a ' Pop

1

2

a = 3


remove stack, a ' Pop

1

a = 2


Data Structures







Become a Patron