题目: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 解题思路: 判断链表有无环,可用快慢指针进行,快指针每次走两步,慢指针每次走一步,如果快指针追上了慢指针,则存在环,否则,快指针走到链表末尾即为NULL是也没追上,则无环. 为什么快慢指针可以判断有无环? 因为快指针先进入环,在慢指针进入之后,如果把慢指针看作在前面,快…