Pointer-manipulation

3 articles

dsa8 min read

Merge Nodes Between Zeros — In-Place Pointer Walk Explained

Learn how to merge all nodes between consecutive zeros in a linked list into a single sum node in O(n) time and O(1) space. A clean simulation problem from LeetCode 2181 that tests in-place pointer manipulation and linked list traversal confidence.

Read →
dsa8 min read

Swap Nodes in Pairs — In-Place Pointer Rewiring Without Swapping Values

LC 24 Swap Nodes in Pairs is a medium linked list interview problem at Microsoft and Bloomberg that tests precise multi-step pointer manipulation. Learn the iterative dummy-head approach and the recursive solution with Python and JavaScript, detailed visual dry run, and interview tips.

Read →
dsa8 min read

Odd Even Linked List — Two-Chain In-Place Grouping Explained

LC 328 Odd Even Linked List is a medium interview problem at Facebook, Amazon, and LinkedIn that tests your ability to maintain two separate pointer chains simultaneously. Learn the O(1) space two-chain pattern with Python and JavaScript, a visual dry run, and interview tips.

Read →