面试8——手撕算法

1.链表有无环判断 //快慢指针 bool LoopList_is( ListNode *List) { if(!List) return false; ListNode *slowPointer,*fastpointer; slowpointer = fastpointer = List; while(slowpointer != null && fastpointer == null)
相关文章
相关标签/搜索