public static /*@pure@*/ int minIndex(int[] ints) {

    int minimum = 0;
    int minIndex = 0;

    for (int i = 0; i < ints.length; i++) {
      if ((i == 0) || (ints[i] < minimum)) {
	minIndex = i;
	minimum = ints[i];
      }
    }

    return minIndex;
  }
public static int minIndex ( int [ ] ints ) { int minimum = 0 ; int minIndex = 0 ; for ( int i = 0 ; i < ints . length ; i ++ ) { if ( ( i == 0 ) || ( ints [ i ] < minimum ) ) { minIndex = i ; minimum = ints [ i ] ; } } return minIndex ; }
Returns index of minimum element in a given
array of integers. First minimum is returned.

@param ints the array of integers
@return the index of the minimum element