Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 给定一个链表,判断是否有环存在.Follow up: 不使用额外空间. 解法:双指针,一个慢指针每次走1步,一个快指针每次走2步的,如果有环的话,两个指针肯定会相遇. Java: public class Solution { public boolean hasCycle(Li…