Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 题意: 判断一个链表是否有环. 解决方案: 双指针,快指针每次走两步,慢指针每次走一步, 如果有环,快指针和慢指针会在环内相遇,fast == slow,这时候返回true. 如果没有环,返回false. /** * Definition for singly-linked li…