Home > Back-end >  The architectural sequence sum of N - S chart and program flow chart
The architectural sequence sum of N - S chart and program flow chart

Time:11-17

According to the following the architectural series summation procedure files, draw the navier-stokes diagram and the program flow chart,
A Private static int maxSumRec (int [], int left, int right) {
If (left==right)
If (a [left] & gt; 0 {
Return a, [left].
} else {
return 0;
}
Int center=(left + right)/2;
Int maxLeftSum=maxSumRec (a, left, center);
Int maxRightSum=maxSumRec (a, center + 1, right);
Int maxLeftBorderSum=0, leftBorderSum=0;
For (int I=center; I>=left; I -)
{
LeftBorderSum +=a, [I].
If (leftBorderSum> MaxLeftBorderSum) {
MaxLeftBorderSum=leftBorderSum;
}
}
Int maxRightBorderSum=0, rightBorderSum=0;
For (int I=center + 1; I<=right; I++) {
RightBorderSum +=a, [I].
If (rightBorderSum> MaxRightBorderSum) {
MaxRightBorderSum=rightBorderSum;
}
}
The return of Max (maxLeftSum, maxRightSum maxLeftBorderSum + maxRightBorderSum);
}
Requirement: the experimental results are listed in the program flow chart and N - S figure,

  • Related