I recently learned merge sort. In my main function, calling my merge sort with end=n-1:
mergesort(arr,0,n-1);
and calling it with n: