Linked List Cycle II
摘要:
1 ListNode *detectCycle(ListNode *head) { 2 if(!head||!head->next) 3 return NULL; 4 ListNode *fast,*slow; 5 fast=head; 6 slow=head; 7 while(fast&&fast->next) 8 { 9 slow=slow->next;10 fast=fast->next->next;11 ... 阅读全文
posted @ 2014-03-18 21:20 crane_practice 阅读(108) 评论(0) 推荐(0) 编辑