Question: This algorithm takes in a sequence of positiveegative integers and returns the maximum possible sum of a contiguous subsequence Ai....Aj. Please revise the algorithm so
This algorithm takes in a sequence of positiveegative integers and returns the maximum possible sum of a contiguous subsequence Ai....Aj. Please revise the algorithm so that it also returns the indices of Ai and Aj.

// Cubic maximum contiguous sum algorithm int maxSubSuml (const vector int> & a) int maxSum = 0; for (int i = 0; i maxSum) maxSum = this Sum; return maxSum
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
