Practice
Learn
← Quit
0 / 0 correct
Algorithms
Medium
1 of 98
How do you detect a cycle in a linked list using O(1) extra space?
A
Floyd's tortoise and hare: move one pointer 1 step and another 2 steps; they meet if there is a cycle
B
Sort the list
C
Store visited nodes in a hash set
D
Reverse the list twice