package normal; import java.util.HashSet; /** * @program JavaBooks * @description: 141.环形链表 * @author: mf * @create: 2019/11/05 10:19 */ /* 题目: 难度:easy 类型:链表 */ public class HasCycle { public static void main(String[] args) { } /** * 哈希 * @param head * @return */ public static boolean hasCycle(ListNode head) { HashSet set = new HashSet<>(); while (head != null) { if (set.contains(head)) {