Merge Sort - Recursion

Can you help debug the code. I am not able to find the error.

@Anaghajain when calling the mergesort function from main() pass n-1 as end not n,
and for loop at line 43 of your code should start from i=s not from 0.

I made these changes still it is showing run-time error.

i think taking 10^6 size for arr and temp is giving error try taking them of 2x10^5 since n can be max this as per contraints.

Thank You! The code worked! :slight_smile:

1 Like