0 votes 0 votes Given a sequence of n real numbers a1,a2,a3...an then to find contiguous subsequence ai,ai+1,ai+2....aj. Such that it's sum is maximum. How much time the above problem will take if you use dynamic programming? Algorithms dynamic-programming time-complexity + – shipra tressa asked Jul 17, 2018 retagged Jun 18, 2022 by makhdoom ghaya shipra tressa 1.5k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes time complexity=O(n) space complexity=O(n)(we can improve it to O(1)) https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/ Anil Ji answered Jul 17, 2018 Anil Ji comment Share Follow See all 0 reply Please log in or register to add a comment.