define o_max and assign i_intaryTb[0];
looping from 0 to i_intaryTb.length -1 ,index += i_one_stepLength
if ( index >= i_intaryTb.length ) then
break the looping;
if ( i_intaryTb[index] > o_max ) then
o_max = i_intaryTb[index];
end if
end looping
return o_max;
So, I got a lot of help with this from my friend Google. I'm not necessarily anywhere near good at programming, but it seems that I can understand this enough to argue that it will terminate and produce the correct results.
i is assigned the length once it reaches i it stops.
Nice. Good algorithm. I can understand it.
ReplyDeleteYou did argue about the finiteness of the algorithm, however, there an algorithm must also be accompanied with a proof of correctness.
-Aviral
I will try to prove it's correctness, I'm really new at this.
ReplyDelete