Operations on Stack
A stack is a non primitive linear data structure. It is an ordered list in which addition of new data item and deletion of already existing data item is done from only one end, known as top of stack.
This is the reason the stack is also called Last in first out (LIFO) type of list.
Stack implementation
1. Static implementation – It gets the use of arrays to create stack.
2. Dynamic implementation – It is also called linked list representation and uses pointers to implement the stack type of data structure.
Operations on STACK
1. PUSH – The process of adding a new element to the top of stack.
2. POP – The process of deleting an element from the top of stack.
- In case no new element can be accommodated, it is called STACK-FULL condition.
- In case no element can be popped this results in the STACK-UNDERFLOW condition.