codinglinked-lists
A dummy node can simplify linked-list edge cases
Anonymous
For insertions or deletions near the head of a singly linked list, a temporary dummy node before the head can make the pointer logic uniform. Return dummy.next afterward. Traversal remains O(n); the dummy node changes edge-case handling, not the asymptotic cost.
0