Professional Documents
Culture Documents
• Next field of last node will keep the address of first node.
Address of
this node is Head pointer will keep the address
suppose of first node of the linked list.
1000
struct node
Data Pointer to next node
{
int data;
struct node * next;
} *head = NULL;
}
}
Case 2: insert node at end in the existing linked list with nodes head = 1500 1000
15 NULL
i. Create new node: new1= 3000
iii. We need to change the next part of node with address 1000.
1000->next = new1(3000)
new1->next = head (1500)
- Last node’s feature is : its next field is head. That we can use to find the address of last node.
-Will this code work if there is only one node in the list? Find and resolve with code.
-Will this code work if there is only one node in the list? Find and resolve with code.
-Will this code work if there is only one node in the list? Find and resolve with code.