判断一个链表是否存在环,有一个Floyd判圈法 tortoise = top hare = top forever: if hare == end : return 'No Loop Found' hare = hare.next if hare == end : return 'No Loop Found' hare = hare.next tortoise = tortoise.next if hare == tortoise: return 'Loop Found' ...