题目链接
解析:

完整代码:
cpp
typedef struct ListNode ListNode;
class Solution {
public:
ListNode* middleNode(ListNode* head) {
ListNode*slow,*fast;
slow = fast = head;
while(fast && fast->next)
{
slow = slow -> next;
fast = fast -> next -> next;
}
return slow;
}
};