update dd

This commit is contained in:
ranwenjie
2021-10-18 15:59:42 +08:00
parent 8f0e12be15
commit 533b9fb5e1
3 changed files with 3 additions and 4 deletions
@@ -91,7 +91,7 @@ int findaddends(int *data,int length,int sum,int *a,int *b);
例如输入的数组为`1, -2, 3, 10, -4, 7, 2, -5` ,和最大的子数组为`3, 10, -4, 7, 2` ,因此输出为该子数组的和18。
1. 蛮力法 fmax(i,j) 找出最大的值,3重循环 ,复杂度 0(n^3)
2. maxendindhere保存当前累加的和,如果<0,就把maxendinghere清零 , max保存最终的最大和
2. maxendindhere保存当前累加的和,如果<0,就把maxendinghere清零 , max保存最终的最大和; 如果都是负数
```
int maxSumOfVector(int *data,int length){