0 votes 0 votes Given a sequence of n real numbers a1,a2,a3,a4…………...an then to find contiguous subsequence Ai,Ai+1,…...Aj.such that its sum is maximum. How much time the above problem will take if you dynamic program? Piyush mishra asked Jan 2, 2019 Piyush mishra 382 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply aimhigh commented Jan 2, 2019 reply Follow Share O(n^2)?? 0 votes 0 votes Somoshree Datta 5 commented Jan 2, 2019 reply Follow Share It can be done in O(n) time by using Kadane's algorithm. https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/ 0 votes 0 votes Shamim Ahmed commented Jan 2, 2019 reply Follow Share O(n) 0 votes 0 votes Please log in or register to add a comment.