摘要:
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 阅读全文
摘要:
class Solution { public: bool hasCycle(ListNode *head) { if(!head) return NULL; ListNode* fast=head; ListNode* slow=head; while(fast->next&&fast->next... 阅读全文