Floyd's cycle detection algorithm in a linked list uses which technique?

  • A Two pointers moving at different speeds
  • B A hash table of visited nodes
  • C Reversing the list
  • D Binary search on the list

Explanation

Floyd's algorithm uses two pointers, a slow one moving one step and a fast one moving two steps; if they meet, the list has a cycle.