Java Array Max Value maxIndex(int[] list)

Here you can find the source of maxIndex(int[] list)

Description

max Index

License

Apache License

Declaration

public static int maxIndex(int[] list) 

Method Source Code

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

public class Main {
    public static int maxIndex(int[] list) {
        int bi = -1;
        for (int i = 0; i < list.length; i++)
            if (bi == -1 || list[i] > list[bi])
                bi = i;//from www .java2 s.  co m
        return bi;
    }

    public static int maxIndex(double[] list) {
        int bi = -1;
        for (int i = 0; i < list.length; i++)
            if (bi == -1 || list[i] > list[bi])
                bi = i;
        return bi;
    }
}

Related

  1. maxIndex(float[] from, int start)
  2. maxIndex(float[] x)
  3. maxIndex(int[] a)
  4. maxIndex(int[] array)
  5. maxIndex(int[] from)
  6. maxIndex(int[] shape)
  7. maxIndex(int[] values, int begin, int end)
  8. maxIndex(Number[] array)
  9. maxIndex(T[] array)