Wednesday, 26 July 2017
Subscribe to:
Post Comments (Atom)
Step 1: If the linked list is empthy (START == NULL)
Write "Sorry Buddy there is no node"
Step 2: If the linked list have only one node (START -> NEXT == START -> PREV)
free(START)
START = NULL
Step 3: If the list have more than one node
PTR = START;
while(PTR ->NEXT != START)
{
PTR = PTR ->NEXT
}
PTR -> NEXT = START -> NEXT
PTR -> NEXT -> PREV =PTR
free(START);
START = PTR ->NEXT
Step 4 : EXIT
Step 1: If the linked list is empthy (START == NULL)
Write "Sorry Buddy there is no node"
Step 2: If the linked list have only one node (START -> NEXT == NULL)
free(START);
START = NULL
Step 3: If the list have more than one node
PTR = START
while(PTR -> NEXT != START)
{
PTR = PTR -> NEXT
}
PTR -> PREV -> NEXT = START
START -> PREV = PTR ->PREV
free(PTR)
Step 4 : EXIT
0 Comment to "Circular Doubly Linked List - Deletion algorithm"
Post a Comment