Java Utililty Methods Array Min Value

List of utility methods to do Array Min Value

Description

The list of methods to do Array Min Value are organized into topic(s).

Method

Numbermin(Number[] array)
Returns the (first occurrence of the) smallest value in the given array.
int index;
index = minIndex(array);
if (index == -1)
    return null;
else
    return array[index];
Tmin(T first, T... others)
min
T result = first;
for (T value : others) {
    if (value.compareTo(result) < 0) {
        result = value;
return result;
Tmin(T... values)
min
T result = null;
if (values != null) {
    for (T value : values) {
        if (compare(value, result, true) < 0) {
            result = value;
return result;
Tmin(T[] args)
min
if ((args == null) || (args.length == 0)) {
    return null;
T minus = null;
for (int i = 0; i < args.length; i++) {
    T t = args[i];
    if ((minus == null) && (t != null)) {
        minus = t;
...
intmin(T[] inputArray, int i, int i0)
Finds the minimum element between to specified indexes of an array
int smallestIndex = i; 
i++; 
while (i <= i0) { 
    if (inputArray[i].compareTo(inputArray[smallestIndex]) < 0) {
        smallestIndex = i; 
    i++;
return smallestIndex;
double[]min_max_mean_stddev(long[] counts)
mimameastddev
double min = Float.MAX_VALUE;
double max = Float.MIN_VALUE;
double mean = 0;
for (long tmp : counts) {
    min = Math.min(tmp, min);
    max = Math.max(tmp, max);
    mean += tmp;
mean /= counts.length;
double stddev = 0;
for (long tmp : counts) {
    stddev += Math.pow(tmp - mean, 2);
stddev /= counts.length;
stddev = Math.sqrt(stddev);
return new double[] { min, max, mean, stddev };
intmin_of_ints(int[] data)
Returns min of an array of ints
int min = data[0];
for (int x = 1; x < data.length; x++) {
    if (data[x] < min) {
        min = data[x];
return min;
float[]minAndMaxOfArray(float[] array)
Returns the minimal and the maximal value in a given array
float[] revan = new float[2];
revan[0] = Float.MAX_VALUE;
revan[1] = -Float.MAX_VALUE;
for (int i = 0; i < array.length; i++) {
    if (array[i] < revan[0]) {
        revan[0] = array[i];
    if (array[i] > revan[1]) {
...
doubleminarr(double[] a)
minarr
double min = a[0];
for (int i = 1; i < a.length; i++)
    if (a[i] < min)
        min = a[i];
return min;
intminArray(int[] arr)
min Array
int retVal = arr[0];
for (int i = 1; i < arr.length; i++) {
    if (arr[i] < retVal)
        retVal = arr[i];
return retVal;