stack algorithm

*push operàtion
1.if top=MAXSIZE-1 then print(stack overflow)
2.otherwise
read the "data" to be inserted
3.top=top+1
4.stack[top]=data
5.stop
*pop operation
1.if top=-1 then
2.print (stack underflow and stop)
3.otherwise
stack [top ] <-null
4.top--
5.stop
*display operation
1.if top==-1   then
print (stack is empty)
2.otherwise
from (i  =0 to top)
print (content of stack)
4.stop

No comments