dsa1 min read
Middle of the Linked List — Fast and Slow Pointers
Find the middle node of a linked list in one pass using the slow/fast pointer technique.
Read →
webcoderspeed.com
1276 articles
Find the middle node of a linked list in one pass using the slow/fast pointer technique.
Detect a cycle in a linked list in O(1) space using Floyd's two-pointer tortoise and hare algorithm.
Merge two sorted linked lists into one sorted list using a dummy head node to simplify pointer management.
Check if a linked list is a palindrome by finding the middle, reversing the second half, then comparing.
Remove duplicate nodes from a sorted linked list in O(n) with a single pointer walk.