Let S = (a1a2; : : : an) be a sequence of integers. Design an algorithm to nd thesubsequence SM = (ai; ai+1; : : : ; aj) of S, with consecutive elements, such that the sum of thenumbers in SM is maximum over all subsequences of S. Note that the sum is assumed to be0 if the subsequence is empty. Your algorithm should run in O(n) time.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here