NAT · 1 mark · Algorithm Design

GATE CS 2019 CS — Q25

Consider a sequence of 14 elements: A=[−5,−10,6,3,−1,−2,13,4,−9,−1,4,12,−3,0]A = [-5, -10, 6, 3, -1, -2, 13, 4, -9, -1, 4, 12, -3, 0].
The subsequence sum S(i,j)=∑k=ijA[k]S(i, j) = \sum_{k=i}^j A[k]. Determine the maximum of S(i,j)S(i, j), where 0≤i≤j<140 \le i \le j < 14. (Divide and conquer approach may be used.)

Answer: __________.