Due: Nov 4, 11:55 pm

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.

For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has the largest sum = 6.

You are to find a **dynamic programming** solution to this problem, and implement it on Leetcode.

Then you will do a runtime analysis of your solution.

Turn in:

- Source code for your solution
- Samples runs showing the operation with input and outputs.
- A complete asymptotic analysis.
- An explanation of how this using the principle of optimality

Edit | Attach | ~~Watch~~ | Print version | History: r1 | Backlinks | Raw View | Raw edit | More topic actions

Copyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding TWiki? Send feedback

Ideas, requests, problems regarding TWiki? Send feedback