Algorithms/Find approximate maximum

Algorithm
Method : findApproimateMax(i_aryTb)

define a constant call factorA and assign 100 define o_intMax is integer and assign i_aryTb[0]; define p_countMax is integer and assign 1 for loop = 1 to (i_aryTb.length - 1) do, index if ( i_aryTb[index] > o_intMax ) then o_intMax  := i_aryTb[index]; p_countMax := 0; else p_countMax = p_countMax + 1; if ( p_countMax bigger or equal factorA ) then return o_intMax and terminate the method; end if      end if   end loop return o_intMax;

Algorithm
Method : findMax(i_aryTB, numberOfSecond) if numberOfSecond <= 0 then numberOfSecond := -1; end if   define a constant factorA := 100; define p_logStart become := current_time; define p_logFinish := p_logStart + ( numberOfSecond ); define o_intMax := i_aryTb[0]; looping from 1 to (aryTb.length - 1), p_intI begin if ( aryTb[p_intI] > o_intMax ) then o_intMax := aryTb[p_intI]; end if; if ( the remainder of p_intI / factorA is zero ) then begin if ( p_logFinish <= current_time and numberofSecond not equal -1 ) then return o_intMax; terminate the method; end if       end if    end looping return o_intMax;

Algorithm
Method : findApproximateMax(i_intaryTb,i_one_stepLength) 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;