NC4 判断链表中是否有环 我的第一种解题思路,双指针迭代(快慢指针)。两个指针向后移动的速度不一样,如果快指针没有到null,而是两个指针指向了同一个节点的话,那么说明链表中就是有换存在的。 public boolean hasCycle(ListNode head) { if(head==null||head.next==null){ return false; } ListNode slow=head,fast=head.next; while(slow!=fast){ if(fast==null||fast.next==null){ return false; } slow=slow...