Java Array Min Value min(int[] x, int length)

Here you can find the source of min(int[] x, int length)

Description

min

License

BSD License

Declaration

public static int min(int[] x, int length) 

Method Source Code

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

public class Main {
    public static int min(int[] x, int length) {
        int m = Integer.MAX_VALUE;
        for (int i = 0; i < length; i++)
            if (x[i] < m)
                m = x[i];/*from www.j  av a  2 s. com*/
        return m;
    }

    public static int min(int[] x) {
        return min(x, x.length);
    }

    public static double min(double[] x, int length) {
        double m = Double.POSITIVE_INFINITY;
        for (int i = 0; i < length; i++)
            if (x[i] < m)
                m = x[i];
        return m;
    }
}

Related

  1. min(int[] in, int x1, int x2)
  2. min(int[] list)
  3. min(int[] values)
  4. min(int[] values)
  5. min(int[] vs)
  6. min(long first, long... rest)
  7. min(long[] arr)
  8. min(long[] array)
  9. min(long[] array)