Skip to content

Latest commit

 

History

History

maximum subarrray

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Maximum subarrray problem solved by Divide and Conquer

There is an additional rule:

The maximum subarray can only have one negative integar

EX:

Given 2 3 4 -1 -2 11 -7

The normal solution 2 3 4 -1 -2 11 is illegal, so the answer is 11

Data input:

The first input is the number of elements in the array(array's size)

The second input is the elements in whole array.

Output:

summation and maximum subarrray