Here you can find the source of maxLocation(double[] list)
Parameter | Description |
---|---|
list | a list of doubles |
public static int maxLocation(double[] list)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . ja v a 2s . c om * This method finds the location of the first minimum of list * @param list a list of doubles * @return the location of the first occurence of the minimum element */ public static int maxLocation(double[] list) { int location = 0; for (int i = 1; i < list.length; ++i) if (list[i] > list[location]) location = i; return location; } /** * This method finds the location of the first minimum of list * @param list a list of doubles * @return the location of the first occurence of the minimum element */ public static int maxLocation(int[] list) { int location = 0; for (int i = 1; i < list.length; ++i) if (list[i] > list[location]) location = i; return location; } }