dsa1 min read
Linked List Cycle — Floyds Tortoise and Hare
Detect a cycle in a linked list in O(1) space using Floyd's two-pointer tortoise and hare algorithm.
Read →
1575 articles
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.
Delete a node given only access to that node by copying the next node value and skipping the next node.