I'm not sure I understand the question. The head pointer is never overwritten, so it always represents the start of the entire linked list. That doesn't change when the node deletion occurs.
The variable head just contains a pointer to the start of the linked list. It doesn't contain the entire linked list. So any changes made to the nodes of the list and their connections will affect a traversal of the list starting at head.
I'm not sure I understand the question. The head pointer is never overwritten, so it always represents the start of the entire linked list. That doesn't change when the node deletion occurs.
The function returns head at the end which has the list after the deleting the required node. How does this happen when we aren't updating head ?
The variable head just contains a pointer to the start of the linked list. It doesn't contain the entire linked list. So any changes made to the nodes of the list and their connections will affect a traversal of the list starting at head.
Got it. Thanks for your reply 😃