题目: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 提示: 首先,题目中要求'without using extra space',指的是空间复杂度必须控制在O(1)内. 因此可以创建两个变量,先同时指向head,然后每一轮循环中,令其中一个变量沿链表向前“走”两步,另一个走“一步”,这样的话每一个循环后他们两者的距离差会…