Question
Given a linked list, determine if it has a cycle in it.
Follow up: Can you solve it without using extra space?
Explanation
双指针,如果有重合,就说明有环。
Given a linked list, determine if it has a cycle in it.
Follow up: Can you solve it without using extra space?
双指针,如果有重合,就说明有环。