if(!head || head->next == NULL) return head; Node* fast = head->next->next,*slow = head; while(fast->next && fast->next->next){ fast = fast->next->next; slow = slow->next; } if(fast != NULL) slow = slow->next; Node* head2 = reverse(slow->next); slow->next = NULL;