Error in Merge sort implementation | Sololearn: Learn to code for FREE!

Error in Merge sort implementation

The code give below is code of merge sort. When I run this program I get output array same as input array? I can't trace where is the problem? Can you trace it?

25th Jan 2018, 3:50 PM
kishore kumar
kishore kumar - avatar
1 Answer
+ 2
Your calculation of n gets 1 as 4/4=1. There isn't a way for C to know how many elements are in your array.
25th Jan 2018, 5:07 PM
John Wells
John Wells - avatar