Skip to content

Linked List: Deletion

Task: Remove 30 from this list

head102040∅REMOVED30no longer in the list1 pointer write, 0 values moved

What you are watching

Deleting from a linked list does not touch the node being removed. You walk to the node before it and point that one past it, and 30 is gone from the list the moment nothing refers to it. One pointer write, and every other node stays exactly where it was - which on an array would have meant shifting the whole tail left.