Find maximum-sum subarray in an integer array

> To find the contiguous subarray within a 1-D array of numbers
(containing at least one positive number) which has the largest sum.
> Kadane's  Algorithm :
http://en.wikipedia.org/wiki/Maximum_subarray_problem
> For example, for the sequence of values −2, 1, −3, 4, −1, 2, 1, −5,
4; the contiguous subarray with the largest sum is 4, −1, 2, 1, with
sum 6.