Practice
Learn
← Quit
0 / 0 correct
Algorithms
Medium
1 of 40
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
Reverse the list twice
D
Store visited nodes in a hash set