Tags:
create new tag
view all tags

LeetCode Exercise 7

Due: Nov 4, 11:55 pm

Moodle Link

53. Maximum Subarray

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:

  1. Source code for your solution
  2. Samples runs showing the operation with input and outputs.
  3. A complete asymptotic analysis.
  4. An explanation of how this using the principle of optimality
Be prepared to discuss you solutions in class.
Topic revision: r1 - 2016-10-31 - JimSkon
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 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