The input to this problem is a sequence S of n it integers (not necessarily positive). The
Fantastic news! We've Found the answer you've been seeking!
Question:
The input to this problem is a sequence S of n it integers (not necessarily positive). The problem is to find the consecutive subsequence of S with maximum sum. Consecutive means that you are not allowed to skip numbers. For example if the input was 12, —14, 1, 23, —6, 22, —34, 13, the output would be 1, 23, —6, 22. Give a linear time algorithm for this problem.
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date: