MediumVery High Frequency30 min
Fast & Slow Pointers (Floyd's)
Detect cycles, find midpoints, and solve linked list problems using two speed pointers.
Floyd's Tortoise and Hare: a slow pointer moves 1 step, fast moves 2. They meet inside a cycle, or fast reaches null (no cycle).
Fast & Slow Pointers
Operations — Step by Step
Find Middle
O(n)When fast reaches null (or last node), slow is at middleStep-by-step1 / 4
Both at head
slow=0, fast=0. Both point to index 0 (val=1).
More in Linked Lists
Linked List Fundamentals
Singly, doubly, and circular linked lists — nodes, pointers, and traversal.
Reverse Linked List
Iterative and recursive reversal patterns — the most fundamental linked list operation.
Merge Lists & K-way Merge
Merge sorted lists using dummy node technique and a min-heap for K lists.