-
Notifications
You must be signed in to change notification settings - Fork 7
Stack
It creates a new stack.
Precondition : it requires the name of the stack
Example : stack create fruits
Note : The created stack will be in the global scope. Under the hood it is an array.
It put an element to stack.
Precondition : it requires the name of the stack and the element.
Example : stack push fruits apple
Removes all elements from stack.
Precondition : it requires the name of the stack.
Example : stack erase fruits
Returns the number of elements in the stack.
Precondition : it requires the name of the stack.
Example : stack size fruits
Removes the next element from the stack.
Precondition : it requires the name of the stack.
Example : stack pop fruits
Returns the next element from the stack.
Precondition : it requires the name of the stack.
Example : stack top fruits
Returns whether the stack is empty.
Precondition : it requires the name of the stack.
Example : stack empty fruits
It destroys the stack.
Precondition : it requires the name of the stack.
Example : stack destroy fruits