Java Array Min Value min(int[] array)

Here you can find the source of min(int[] array)

Description

min

License

Apache License

Declaration

public static double min(int[] array) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

public class Main {
    public static double min(int[] array) {
        int min = Integer.MAX_VALUE;
        for (int a : array) {
            if (a < min) {
                min = a;//from   www.jav  a2 s  . c o m
            }
        }
        return min;
    }

    public static double min(ArrayList<Double> array) {
        double min = Double.MAX_VALUE;
        for (double a : array) {
            if (a < min) {
                min = a;
            }
        }
        return min;
    }

    public static double min(double[] array) {
        double min = Double.MAX_VALUE;
        for (double a : array) {
            if (a < min) {
                min = a;
            }
        }
        return min;
    }
}

Related

  1. min(int[] arr)
  2. min(int[] arr, int count)
  3. min(int[] array)
  4. min(int[] array)
  5. min(int[] array)
  6. min(int[] array)
  7. min(int[] elements)
  8. min(int[] in, int x1, int x2)
  9. min(int[] list)