Complete the code to split the array into two halves.
mid := len(arr) [1] 2
We divide the length of the array by 2 to find the middle index.
Complete the code to recursively sort the left half of the array.
left := mergeSort(arr[:[1]])We pass the left half of the array from start to mid index to mergeSort.
Fix the error in the merge function call to combine sorted halves.
return merge(left, [1])
The merge function combines the sorted left and right halves, so we pass 'right'.
Fill both blanks to complete the merge function's loop conditions.
for i, j := 0, 0; i < [1] && j < [2]; {
The loop runs while i is less than length of left and j is less than length of right.
Fill all three blanks to append remaining elements after merging.
for i < [1] { result = append(result, left[[2]]) i++ } for j < [3] { result = append(result, right[j]) j++ }
We append remaining elements from left starting at i, and from right starting at j, until their lengths.
