Stack

Stack is abstract data type and linear data structure.




Concept of Stack

A Stack is data structure in which addition of new element or deletion of existing element always takes place at a same end. This end is known as the top of the stack. That means that it is possible to remove elements from a stack in reverse order from the insertion of elements into the stack.

One other way of describing the stack is as a last in, first out (LIFO) abstract data type and linear data structure.





Operations on Stack

The stack is basically performed two operations PUSH and POP.
Push and pop are the operations that are provided for insertion of an element into the stack and the removal of an element from the stack, respectively.
PUSH:- PUSH operation performed for the adding item to the stack.
POP:- POP operation performed for removing an item from a stack.