List of utility methods to do Array Min Value
int | minIdx(int[] in) min Idx int out = in[0]; for (int i = 1; i < in.length; i++) { if (in[i] < in[out]) { out = i; return out; |
double | minIgnoreIndex(double[] array, int indexToIgnore) min Ignore Index double min; if (indexToIgnore != 0) { min = array[0]; } else { min = array[1]; for (int i = 0; i < array.length; i++) { if (indexToIgnore == i) { ... |
char[] | minimum(char[] set) minimum boolean[] book = emptyBook(); for (char b : set) { book[b] = true; return bookToSet(book, true); |
double | minimum(double[] list) minimum double min = list[0]; for (int i = 1; i < list.length; ++i) if (list[i] < min) min = list[i]; return min; |
float | minimum(float[] array) Find the minimum element in an array if (array.length <= 0) throw new IllegalArgumentException("The array is empty"); float min = array[0]; for (int i = 1; i < array.length; i++) if (array[i] < min) min = array[i]; return min; |
int | minimum(int... values) minimum int ret = values[0]; for (int i = 1; i < values.length; i++) { ret = Math.max(ret, values[i]); return ret; |
long | minimumDotProduct(int[] a, int[] b) minimum Dot Product Arrays.sort(a); Arrays.sort(b); long result = 0; for (int i = 0; i < a.length; i++) { result += (long) a[i] * b[b.length - i - 1]; return result; |
int | minimumOf(final int[] array) minimum Of int minimum = array[0]; for (int i = 1; i != array.length; i++) if (array[i] < minimum) minimum = array[i]; return minimum; |
Integer | minimumWordLength(String[] words) minimum Word Length Integer minLength = Integer.MAX_VALUE; for (String word : words) { if (minLength > word.length()) { minLength = word.length(); return minLength; |
double | minIn(double[] array) min In double min = Double.MAX_VALUE; for (double val : array) { min = min > val ? val : min; return min; |