Linked-list deletion (source code)

= Linked-list deletion

Remove a node by changing the preceding link to its successor; deleting the head instead changes the external head pointer. A traversal retaining the last kept node can remove consecutive rejected nodes without advancing that predecessor. When every node is rejected, the head becomes the empty-list pointer.