can you please edit this code ?
Giving me error(segmentation fault)
@premang
There are lot of mistake in your code. I am pointing out those mistakes
- line no. 56 should be while(fast!=NULL && fast->next!=NULL) { , It might be possible that fast->next is NULL so fast->next->next would not exist.
- In function merge(), if(a==NULL) return b; and when if(b==NULL) return a;
- In function merge_sort() base case should be if(head->next==NULL || head==NULL) { return head; }
- line 103 should be a=merge_sort(a);
- line 104 should be b=merge_sort(b);
1.First point is incorrect according to this,
In https://online.codingblocks.com/app/player/42363/content/98094/568/lecture
at time stamp 7:03 sir did the same.
i modified the code
still not working