Home »
» POP_LINKSTACK(INFO, LINK, TOP, AVAIL, ITEM)
Unknown 9:21:00 AM
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.
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :
CSE SOLVE
Related Posts:
Inserting at the Beginning of a List
Algorithm: INSFIRST(INFO, LINK, START, AVAIL, ITEM)
This algorithm inserts ITEM as the first node in the list.
1. [OVERFLOW?] If AVAIL = NULL , then : Write: OVERFLOW… Read More
Deleting the Node Following a Given Node
Algorithm: DEL(INFO, LINK, START, AVAIL, LOC, LOCP)
This algorithm deletes the node N with location LOC, LOCP is the location of the node which precedes N or , where N is the first node… Read More
Deleting the Node with a Given ITEM of Information
Procedure: DELETE(INFO, LINK, START, AVAIL, ITEM)
This algorithm deletes from a linked list the first node N which contains given ITEM of information.
1. [Use procedure FINDB to find the location o… Read More
Deleting the Node Following a Given Node
Algorithm: DEL(INFO, LINK, START, AVAIL, LOC, LOCP)
This algorithm deletes the node N with location LOC, LOCP is the location of the node which precedes N or , where N is the first node… Read More
Deleting the Node with a Given ITEM of Information
Procedure: FINDB(INFO, LINK, START, ITEM, LOC, LOCP)
This procedure finds the location LOC of the first node N which contains ITEM and the location LOCP of the node preceding N. If ITEM does not appear in the… Read More
0 comments:
Post a Comment