Complete the code to split the array into two halves.
let mid = arr.len() [1] 2;
We divide the length by 2 to find the middle index for splitting.
Complete the code to recursively sort the left half of the array.
let left = merge_sort(&arr[0..[1]]);
The left half is from index 0 up to mid (exclusive).
Fix the error in the merge function call to combine sorted halves.
merge(&left, &[1])We merge the left and right sorted halves, so the second argument must be right.
Fill both blanks to complete the merge function signature.
fn merge(left: &[i32], [1]: &[i32]) -> Vec<i32> { [2] }
The second parameter must be named with type, and the function returns a new vector.
Fill all three blanks to complete the merge logic for comparing elements.
if left[i] [1] right[j] { result.push(left[i]); i += [2]; } else { result.push(right[j]); j += [3]; }
We compare elements with <= and increment indices by 1 after pushing.
