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.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE
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.
0 comments:
Post a Comment