Mazdak Farrokhzad edited Version 3.tex  over 10 years ago

Commit id: 0539a019384c7bad5d3713827598642eea1b5777

deletions | additions      

       

2 int thisSum = 0; (1 op)  3 for( int i = 0, j = 0; (2 op)  4 j < a.length; (2 op/turn + 2 extra turn at end of loop)  5 j++ ) { (1 op/turn) op/turn, compiler will probably turn it to ++j)  6 thisSum += a[j]; (2 op/turn)  7 if( thisSum > maxSum ) { (2 op/turn, if is most complex: so we disgard else-if )  8 maxSum = thisSum; (2 op/turn)