Skip to content

Delete a given node in a linked list ​

Delete a given node in a linked list — LeetCode

Delete a node from a singly linked list when you are given access only to that node, not to the head.

Approach ​

The given node is to be deleted. So instead, make the given node same as the given node's next. Drop the next node.

Remarks ​