Question: Given the pseudocode below, choose the correct recursive expression for the runtime, T(n). (You can assume indexing begins at 1.) def Fun(A, lo, hi): if

Given the pseudocode below, choose the correct recursive expression for the runtime, T(n). (You can assume indexing begins at 1.) def Fun(A, lo, hi): if hi > lo { mid1 = floor (lo + (hi-lo)/3) mid2 = floor (10 + 2(hi-lo)/3) for i = lo to midi { A[i] += 1 A[lo+hi-i] -= 1 } Fun(A, lo, mid1) Fun (A, mid1+1, mid2) Fun (A, mid2+1, hi) } else { return 1 } OT(n) = 3T(n/3) OT(n) = 3T(n/3) + cn OT(n) = 2T (n/3) +T(2n/3) + cn OT(n) = 3T(n 3) OT(n) = 2T(n/3) +T(2n/3) None of these
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
