Merge sort code

sir the code did not work
node* sort(node *head)
{
if(head==nullptr||head->next==nullptr)
return head;
node *mid=mid_point(head);
node *first=head;
node *second=mid->next;
mid->next=nullptr;
first=sort(first);
second=sort(second);
node *ans=merge(first,second);
return ans;
}

Hey @mzk1994
Please share your complete code in CB ide

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.