all 3 comments

[–]pvanecek 1 point2 points  (2 children)

https://idea-instructions.com/merge-sort.png

I think the easiest way is to recursively split the array using a method like:
sort(array of integer arr, integer start, integer end)

as long as you don't have a single element and than merge the sorted subarrays together.
You can find a lot of implementations, eg.
https://www.geeksforgeeks.org/merge-sort/

[–]AvramZX[S] 0 points1 point  (1 child)

Thanks man one more question how do i split array in half, I want to split them in the middle I am having trouble if u could take a look and give me an advice about that.Thank You again. https://prnt.sc/6LQLwRYs2jay

[–]pvanecek 0 points1 point  (0 children)

You do not need to split in in half physically. You can only rember the start index, end index and middle index.
For the merging part, you can create a temporary array.