Does the problem just want to implement the example or all singly linked list?


  • 3
    W

    For singly linked list, we can only know the current node and its next, we cannot know its previous, so how can we change the relation between its previous and the node itself? And I don't think change the value of the node is a good idea, the operation unit is the node, if change the value in the node, we need to change all nodes after the deleted node. So dose this problem just want us solve the example or for general singly linked list?


  • 2

    what do you mean by " if change the value in the node, we need to change all nodes after the deleted node"?

    We only need to change the value of target node to the value of its next, and then delete the next node.

    Only 1 value is changed


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.