1. [Avail Space?] If AVAIL = NULL, then Write
OVERFLOW AND Exit
2. [Remove first node from AVAIL list]
Set NEW : = AVAIL and AVAIL : = LINK[AVAIL].
3. Set INFO[NEW] : = ITEM [Copies ITEM into new node]
4. Set LINK[NEW] : = TOP [New node points to the original top node in the stack]
5. Set TOP = NEW [reset TOP to point to the new node at the top of the stack]
0 comments:
Post a Comment