Doesn't this need a variable pointing to the linked list? (Javascript)


  • 3
    D

    How can you delete a node from a linked list, given only the node, when you do not have a variable pointing at the linked list from which you want to delete the node? Maybe I am missing something here.

    Note: I'm using Javascript.


  • 0
    R

    That's what I thought at first too, but if you think about, you really only need to shift over all the values only from everything to the right to the left by 1.


Log in to reply
 

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