struct node* findMiddle(struct node* head){ if(head == NULL)exit(1); struct node* slow; struct node* fast; fast = slow = head; while(fast -> next != NULL && fast != NULL && fast -> next -> next != NULL){ slow = slow -> next; fast = fast -> next -> next; } return slow; }