Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 746 Bytes

README.md

File metadata and controls

11 lines (6 loc) · 746 Bytes

MaximumSubarrayProblem

NOTE: This project is aimed towards solving the maximum subarray problem using Dynamic Programming, which is the most efficient way of solving this kind of problem. Time Complexity: O(n)

The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum.

Solution

Class MaximumSubarrayProblem shows the classical problem. The input Array may contain positive and negative numbers.

Class MaximumSubarrayProblemColor is a slight variation of this problem. The input Array contains colors. Each color has its own value (positive or negative integer).