Stack
Stack
Stack
5 10 15 20 25
0 1 2 3 4 5 6 7 8 9
Here, TOP = 4
And, MAX = 10
OPERATIONS ON A STACK
A stack supports three basic operatioins:
1. Push: The push operation adds an element to the top
of the stack
2. Pop: The pop operation removes the element from the
top of the stack.
3. Peek: The peek operation returns the value of the
topmost element of the stack.
STACK OVERFLOW AND STACK
UNDERFLOW