Comp Science Question Divide and conquer

40 Views Asked by At

Design a O(n log(n)) time algorithm that computes two indices i and j (where i ≤ j) for which the sum A[i] + A[i + 1] + · · · + A[j − 1] + A[j] is maximum. Describe your algorithm in plain English. Moreover, you must use the Divide and-Conquer approach, write the recursion equation for the time of computation of your algorithm and solve it.

What i did to start off this question is we are given T(n)=2T(n/5)+√n

=$2(2T(n/(5^2))+√n/5)+√n$ = $4(2T(n/5^3)+√n/5^2)+√n$ = $8(2T(n/5^4)+√n/5^3)+√n$

etc.

I got stuck here, not sure where to do now.