CodeMosa
Master LeetCode Patterns
All Patterns
Collections
Sign In
Back
Fast-Slow Pointers
Question 1 of 12
8% Complete
Easy
How does the fast-slow pointer technique detect a cycle in a linked list?
A
Fast pointer moves 2 steps, slow moves 1 step; they meet if there's a cycle
B
Fast pointer checks ahead for duplicates
C
Slow pointer marks visited nodes
D
Fast pointer reaches end first if no cycle
Need a hint?
Think about relative speeds