在刷LeetCode的时候遇到了。。查了一下维百,Kadane是卡内基梅隆大学的教授,这个算法是为了解决最大子序列的和(maximum subarray)提出的。
以下资料全部来自维基百科:
1、什么是maximum subarray problem?
In computer science, the maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum. 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.
The problem was first posed by Ulf Grenander of Brown University in 1977, as a simplified model for maximum likelihood estimation of patterns in digitized images. A