标签:font while style 输出 tno entry span hash class
分析一:用HashSet解决
1 public class Solution { 2 public ListNode EntryNodeOfLoop(ListNode pHead) 3 { 4 if(pHead==null){return null;} 5 HashSet<ListNode> set=new HashSet<ListNode>(); 6 while(pHead!=null){ 7 if(!set.add(pHead)){ 8 return pHead; 9 } 10 pHead=pHead.next; 11 } 12 return null; 13 } 14 }
标签:font while style 输出 tno entry span hash class
原文地址:https://www.cnblogs.com/JingM/p/10962308.html