Java Array Min Value min(int[] values)

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

Description

min

License

Open Source License

Declaration

public static int min(int[] values) 

Method Source Code

//package com.java2s;

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

    public static int min(int[][] values) {
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < values.length; i++) {
            for (int j = 0; j < values[i].length; j++) {
                if (values[i][j] < min) {
                    min = values[i][j];
                }
            }
        }
        return min;
    }
}

Related

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