The tool classes are as follows:
Public classArrayhelper {#regionDouble array Maximum Value/// <summary> ///double array Maximum value/// </summary> /// <param name= "Array" ></param> /// <returns></returns> Public Static DoubleDoublemax (Double[] Array) { if(Array = =NULL) return 0; if(Array. Length <=0) return 0; Doublemax = array[0]; for(inti =1; I < array. Length; i++) { if(Max <Array[i]) {Max=Array[i]; } } returnMax; } #endregion #regionDouble array Minimum value/// <summary> ///double array Minimum value/// </summary> /// <param name= "Array" ></param> /// <returns></returns> Public Static DoubleDoublemin (Double[] Array) { if(Array = =NULL) return 0; if(Array. Length <=0) return 0; DoubleMin = array[0]; for(inti =1; I < array. Length; i++) { if(Min >Array[i]) {min=Array[i]; } } returnmin; } #endregion #regionint array Maximum Value/// <summary> ///int array Maximum value/// </summary> /// <param name= "num" ></param> /// <returns></returns> Public Static intIntmax (int[] num) { if(num = =NULL) return 0; if(Num. Length <=0) return 0; intA = num[0]; for(inti =0; I < Num. Length; i++) { if(A <Num[i]) {a=Num[i]; } } returnA; } #endregion #regionint array Minimum value/// <summary> ///int array Minimum value/// </summary> /// <param name= "num" ></param> /// <returns></returns> Public Static intIntmin (int[] num) { if(num = =NULL) return 0; if(Num. Length <=0) return 0; intA = num[0]; for(inti =0; I < Num. Length; i++) { if(A >Num[i]) {a=Num[i]; } } returnA; } #endregion }
Getting Started with C # programming--Finding the minimum value of array maximums