1. [Stack has an item to be removed?] If TOP = NULL, then Write:
UNDERFLOW AND Exit
2. Set ITEM : = INFO[TOP] [Copies the top element of STACK ITEM into ITEM]
3. Set TEMP : = TOP and TOP = LINK[TOP] [Remember the old value of the TOP pointer in TEMP and reset TOP to point to the next element in the stack]
4. [ Return Remove node from AVAIL list]
Set LINK[TEMP] = AVAIL and AVAIL = TEMP.
5. Exit.4. [ Return Remove node from AVAIL list]
Set LINK[TEMP] = AVAIL and AVAIL = TEMP.
0 comments:
Post a Comment