Category
linked list
2 articles
In-Place Reversal of a Linked List: The 3-Pointer Dance Every Interviewer Expects
TLDR: Reversing a linked list in O(1) space requires three pointers — prev, curr, and next. Each step: save next, flip curr.next to point backward, advance both prev and curr. Learn this once and you unlock four reversal variants that appear constant...
•17 min read

Fast and Slow Pointer: Floyd's Cycle Detection Algorithm Explained
TLDR: Move a slow pointer one step and a fast pointer two steps through a linked structure. If they ever meet, a cycle exists. Then reset one pointer to the head and advance both one step at a time —
•21 min read
