Complete the code to correctly 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 correctly call the recursive function on the left half.
MergeSort(arr, low, [1]);The left half is from low to mid.
Fix the error in the base case condition to stop recursion correctly.
if (low [1] high) return;
The recursion stops when low is greater than or equal to high.
Fill both blanks to correctly express the recurrence relation for Merge Sort.
T(n) = 2T(n [1] 2) [2] cn
The recurrence relation splits the problem in half and adds linear work.
Fill all three blanks to complete the Master Theorem case for Merge Sort's recurrence.
If a = 2, b = 2, and f(n) = [1], then T(n) = [2]([3]).
Merge Sort's recurrence solves to Θ(n log n) using Master Theorem with f(n) = cn.
