dsa1 min read
Intersection of Two Linked Lists — Two Pointer Length Trick
Find the intersection node of two linked lists in O(n) O(1) by switching pointers at the end of each list.
Read →
1575 articles
Find the intersection node of two linked lists in O(n) O(1) by switching pointers at the end of each list.
Convert a linked list representing a binary number to its integer value using left-shift accumulation.
Remove all nodes with a given value from a linked list using a dummy head to handle edge cases cleanly.
Remove the nth node from the end in one pass using two pointers offset by n steps and a dummy head.
Swap every two adjacent nodes in a linked list without modifying node values using pointer rewiring.