Two fundamental operations performed on the stack are PUSH and POP.
Push Operation on Stack
PUSH adds a new element at the TOP of the stack. It is an insertion operation.
We can add elements to a stack until it is full. A stack is full when no more elements can be added to it. Trying to add an element to a full stack results in an exception called ‘overflow’.
Pop Operation on Stack
POP operation is used to remove the top most element of the stack, that is, the element at the TOP of the stack. It is a delete operation .
We can delete elements from a stack until it is empty i.e. there is no element in it. Trying to delete an element from an empty stack results in an exception called ‘underflow’.