I dont understand the merge sort. Please explain

Please explain me how the commands are working in merge sort.

mergesort(a,s,mid)
mergesort(a,mid+1,e)
merge(a,s,e)

mergesort(a,s,mid) —> you have sorted the first half array
mergesort(a,mid+1,e) —> you have sorted the other half.
merge(a,s,e) —> now you have to merge the two half and that is the answer.

Explain the working of it. i am not able to get how recursion works over here

Can you please be more descriptive, which part is confusing you. The recursion part is the same as
mergesort(a,s,mid) —> you have sorted the first half array
mergesort(a,mid+1,e) —> you have sorted the other half.
merge(a,s,e) —> now you have to merge the two half and that is the answer.
keep on dividing the array into left and right halves, and do the merge part.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.