Maximum SubArray Problem
Suppose that array A consists of the sequence of values −2, 1, −3, 4, −1, 2, 1, −5, 4. Then the contiguous subarray with the largest sum is 4, −1, 2, 1, with sum 6.This problem can be done in O(n) t
原创
2008-05-18 13:46:00 ·
298 阅读 ·
0 评论