解题思路是有两个指针,一个快指针,一个慢指针。慢指针每次移动一个结构体,快指针每次移动两个结构体。如果他们指向空,则没有环,如果他们相等,则有环。 C语言代码如下 * @param head ListNode类 * @return bool布尔型 */ bool hasCycle(struct ListNode* head ) { // write code here struct ListNode*fast=head; struct ListNode*slow=head; if(slow==NULL||slow->next==NULL||fa...