2016年6月7日
摘要: leetcode上有一个分享的解法很清晰: Alogrithm Description: Step 1: Determine whether there is a cycle 1.1) Using a slow pointer that move forward 1 step each time 1 阅读全文
posted @ 2016-06-07 15:32 summerkiki 阅读(188) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: bool hasCycle(ListNode *head) { if(!head) return NULL; ListNode* fast=head; ListNode* slow=head; while(fast->next&&fast->next... 阅读全文
posted @ 2016-06-07 14:41 summerkiki 阅读(166) 评论(0) 推荐(0) 编辑