Reputation: 265
Please help me understand how s and f are getting random values and code is behaving this way.
Following is my code for MergeSort :
Problem
My linked list orginally have following values in the following order: 6 2 53 1 3 5 30 100
When I cout the values of cut, f ,s it gives following:
and after last value of s, it says stopped working as if a segmentation fault has occured.
Question: I do not understand that how s and f are getting random values and code is behaving this way.
Upvotes: 1
Views: 207
Reputation: 6136
Probably you need the following line at the end of your else block:
return merged;
Upvotes: 2