GATE CS 2019 · Question 35 · Algorithms · Numerical answer (NAT) · 1 mark · no negative marks
Consider a sequence of 14 elements: A = [-5, -10, 6, 3, -1, -2, 13, 4, -9, -1, 4, 12, -3, 0]. The subsequence sum S(i,j) = Σₖ₌ᵢʲ A[k]. Determine the maximum of S(i,j), where 0 ≤ i ≤ j < 14. (Divide and conquer approach may be used.)
Answer
Answer 29
Answer from the official GATE CS 2019 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes