Sumedh

Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?




Copy the data from the next node into the current node and delete the next node. This won't work if the node to be deleted is the last node. In that case mark it as dummy.




Copyright © 2002 - 07 Sumedh K