Two Way Link List

3
TO INSERT A NODE IN THE MIDDLE OF A TWO WAY LINK LIST First we suppose a pointer to traverse the list this pointer will contain the address of the link that contain the address to its next node. Now we point the first link part which carry the address of previous node to the link part of 2nd node. Now the 2nd link part of the inserted node will point to the pointer. Thus node is inserted.

description

Insert and Delete a Node in a Two-Way Linked List

Transcript of Two Way Link List

TO INSERT A NODE IN THE MIDDLE OF A TWO WAY LINK LIST

First we suppose a pointer to traverse the list this pointer will contain the address of the link that contain the address to its next node.

Now we point the first link part which carry the address of previous node to the link part of 2nd node.

Now the 2nd link part of the inserted node will point to the pointer. Thus node is inserted.

TO DELETE A NODE IN THE MIDDLE OF A TWO WAY LINK LISTFor deleting any element present in middle of the link list.

We have to use a pointer for first searching that item in the link list.

This pointer will carry the address of the previous node of the deleting node. That means this will carry the previous address. Now make that pointer is points towards the forward address that mean the pointer that carry the address of next node.

In the last the make the link part which consist the address of previous node to NULL. Thus deleting that node.