首页 > TAG信息列表 > 0141
LeetCode 0141 Linked List Cycle
原题传送门 1. 题目描述 2. Solution 1 1、思路分析 用set 保存结点元素,若结点已存在则有环,遍历结束无重复则表示无环。 2、代码实现 package Q0199.Q0141LinkedListCycle; import DataStructure.ListNode; import java.util.HashSet; import java.util.Set; public class Solleetcode-0141 linked-list-cycle
Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to den隐藏 Thread.sleep
隐藏 Thread.sleep 无聊随便写写不做任何用途 实现原理: 1.反射调用Thread.sleep方法 2.把 Class.forName("java.lang.Thread ") 中的字符串 java.lang.Thread 换成ascii码 3.使用int数组来装,同时把ascii码转 16进制,8进制,2进制 4.sleep方法同样如此 5.sleep时间用2<<9 = 1024 大概1