Complete the code to calculate the midpoint for dividing the array.
int mid = (low + [1]) / 2;
The midpoint is calculated by adding low and high indices and dividing by 2.
Complete the code to recursively call the function on the left half of the array.
mergeSort(arr, low, [1]);The left half is from low to mid.
Fix the error in the base case condition to stop recursion.
if (low [1] high) return;
The recursion stops when low is greater than or equal to high, meaning one or no elements.
Fill both blanks to complete the recurrence relation for merge sort.
T(n) = 2T(n [1] 2) [2] cn
The recurrence relation splits the problem into two halves of size n/2 and adds linear time cn for merging.
Fill all three blanks to complete the Master Theorem case for merge sort.
If a = 2, b = 2, and f(n) = cn, then T(n) = [1](n \lg n) where n^[2] [3] f(n).
According to the Master Theorem case 2, when f(n) = \Theta(n^{log_b a}), the solution is \Theta(n^{log_b a} \lg n).
