https://leetcode-cn.com/problems/middle-of-the-linked-list/
思路:直接快慢指针,慢指针走一步,快指针走两步(注意基偶)。
struct ListNode* middleNode(struct ListNode* head){ struct ListNode* slow=head; struct ListNode* fast=head; if(head->next==NULL) return head; while(fast!=NULL && fast->next!=NULL) { slow=slow->next; fast=fast->next->next; } return slow; }