Delete a node in linked list without head pointer

Delete node in linked list without head pointer

Generally, people ask the question to delete a node in linked list without head pointer. It is a tricky question because the general approach to delete the given node is that traverse the linked list till the node which you want to delete. In this article, I will describe that how we can delete a node without using the head pointer.

You can also see, Delete a Linked List node using the head pointer

There is no practical solution to delete a node directly by given pointer, we need to do some trick. We need to copy the data from the next node to the current node by given pointer to be deleted and delete the next node.

 

Note: You can not use this technique to delete the last node.

Program to delete a node in linked list without head pointer

 

 

Delete a node in linked list without head pointer


Leave a Reply