Delete linked list node
Closed this issue · 2 comments
hussamEL-Hwary commented
In linkedlist > list_algorithms>delete_node method will cause a problem in these cases.
- The node is the tail node
node.next.next
will fail - The node is
None
- If the node is the head node then we will lose head after deleting the node
Recommended solution 💡
A second parameter should be passed for the previous node to correctly delete the node.
Abhijit2505 commented
@hussamEL-Hwary please fix it up, it's a valid issue.
hussamEL-Hwary commented
Thank you! I will work on it.