摘要: ## 141. 环形链表 ### 1.哈希表法: **将节点依次加入set,如果有重复就是有环。** ``` public class Solution { public boolean hasCycle(ListNode head) { Set set = new HashSet(); while 阅读全文
posted @ 2023-06-20 21:45 Chenyi_li 阅读(11) 评论(0) 推荐(0)