ALGO 1..
PUSH(STACK,TOP,MAXSTK,ITEM)
This procedure pushes an ITEM onto a stack.
1.[Stack already filled?]
if TOP = MAXSTK, then: print: OVERFLOW, and return.
2. Set TOP:= TOP+1. [INCREASE TOP BY 1]
3. Set STACK[TOP]:= ITEM.[inserts ITEM in new TOP position.]
4. Return.


Shweta LodhaRank #31 · 39.8K reputationPosted Apr 1, 2014, 7:28 PM EDT
Abhishek JaiswalRank #126 · 17.5K reputationPosted Apr 2, 2014, 4:00 AM EDT
but thanks!