1

This is similar to the classic interview question of removing a middle node from a LinkedList given only a pointer to that node. Now, what if you were only given a pointer to the node that comes AFTER the node you want to delete? Is this even possible with a Singly Linked List?

Any input is appreciated. Thanks.

Peter
  • 31
  • 1
  • You could use the `gc` module to find the node that holds a reference to the node after the one to be deleted. – kindall Mar 08 '19 at 03:01
  • Are you looking for a Python-specific solution to this problem, or something more general, using just normal linked list interfaces? Because the latter is impossible. – Blckknght Mar 08 '19 at 04:26

0 Answers0