this code is giving a run error help me out
Mergersort linked list
in this function
node midoflist(nodehead)
{
if(head==NULL||head->next==NULL)
return head;
int l=len(head);
nodeslow=head;
nodefast=head;
while(fast->next!=NULL&&fast!=NULL)
// correct should be
while(fast->next!=NULL&&fast->next->next!=NULL)
{
fast=fast->next->next;
slow=slow->next;
}
return slow;
}
I did the changes but its still not working
please check again because i tried this change once again and it’s working
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.