List of utility methods to do Array Max Value
int | findMaxIndex(final int[] array) find Max Index int maxIndex = 0; for (int i = 1; i < array.length; i++) { if (array[maxIndex] < array[i]) { maxIndex = i; return maxIndex; |
int | findMaxIndex(int[] a) Finds the index in 'a' with the largest value. int max = a[0]; int index = 0; for (int i = 1; i < a.length; i++) { int val = a[i]; if (val > max) { max = val; index = i; return index; |
int | findMaxIndex(int[] arr) find Max Index return findMaxIndex(arr, 0, arr.length);
|
void | findMaxOverlap(final int[] overlapRange, final int[] outputRange, final int[] min, final int[] max) find Max Overlap final int minStart = findMinimaGreaterOrEqual(min, overlapRange[0]); final int correctedMinStart = backtrackForHalfInIntervals(minStart, max, overlapRange[0]); outputRange[0] = correctedMinStart; final int maxEnd = findMaximaLessOrEqual(min, overlapRange[1]); outputRange[1] = maxEnd; |
int | findMaxValue(int[] array) find Max Value return array[findMaxIndex(array)];
|
int | findMaxValueIndex(double[] d) find Max Value Index int index = 0; double maxVal = d[0]; for (int i = 0; i < d.length; i++) { if (d[i] > maxVal) { index = i; maxVal = d[i]; return index; |
int | max(boolean useInt, int... value) Calculates the maximum of the given parameters int max = Integer.MIN_VALUE; for (int d : value) { max = Math.max(max, d); return max; |
byte | max(byte[] arr) max byte maxValue = Byte.MIN_VALUE; for (byte value : arr) { if (value > maxValue) { maxValue = value; return maxValue; |
byte | max(byte[] array) max if (array.length == 0) return 0; byte res = array[0]; for (int i = 1; i < array.length; i++) { res = (byte) Math.max(res, array[i]); return res; |
byte | max(byte[] array) Returns the maximum symbol in an array. if (array == null) throw new IllegalArgumentException("The ArrayEx must not be null"); else if (array.length == 0) throw new IllegalArgumentException("ArrayEx cannot be empty."); byte max = array[0]; for (int i = 1; i < array.length; i++) if (array[i] > max) max = array[i]; ... |