Complete the code to calculate the midpoint for dividing the array.
let mid = (low [1] high) / 2;
The midpoint is found by adding low and high indices and dividing by 2.
Complete the code to recursively call the function on the left half.
divide_and_conquer(arr, low, [1]);Left half ends at mid - 1 index.
Fix the error in the base case condition to stop recursion.
if low [1] high { return; }
Recursion stops when low is greater than high, meaning no elements to process.
Fill both blanks to complete the recurrence relation for merge sort.
T(n) = 2T(n [1] 2) + [2]n
The recurrence relation divides n by 2 and adds linear time for merging.
Fill all three blanks to complete the master theorem case for T(n) = aT(n/b) + f(n).
If f(n) = Θ(n^[1]), and log_b(a) = [2], then:<br> - If [3] > log_b(a), T(n) = Θ(f(n))
Master theorem compares f(n) growth rate c with log base b of a to determine T(n).
