Here you can find the source of max_index(int[] v)
public static int max_index(int[] v)
//package com.java2s; //License from project: LGPL public class Main { public static int max_index(int[] v) { int a = v[0]; int i = 0; for (int j = 1; j < v.length; j++) { if (v[j] > a) { a = v[j];//from w ww . j a va 2 s . com i = j; } } return i; } public static int max_index(double[] v) { double a = v[0]; int i = 0; for (int j = 1; j < v.length; j++) { if (v[j] > a) { a = v[j]; i = j; } } return i; } }