面試8——手撕算法

1.鏈表有無環判斷 //快慢指針 bool LoopList_is( ListNode *List) { if(!List) return false; ListNode *slowPointer,*fastpointer; slowpointer = fastpointer = List; while(slowpointer != null && fastpointer == null)
相關文章
相關標籤/搜索