Java Utililty Methods Array Max Value

List of utility methods to do Array Max Value

Description

The list of methods to do Array Max Value are organized into topic(s).

Method

intmaxIndex(int[] a)
max Index
int currentMax = a[0];
int currentMaxIndex = 0;
for (int i = 1; i < a.length; i++) {
    if (a[i] > currentMax) {
        currentMax = a[i];
        currentMaxIndex = i;
return currentMaxIndex;
intmaxIndex(int[] array)
max Index
int maxIndex = 0;
for (int i = 0; i < array.length; i++) {
    if (array[maxIndex] < array[i]) {
        maxIndex = i;
return maxIndex;
intmaxIndex(int[] from)
max Index
int result = 0;
for (int i = 1; i < from.length; ++i)
    if (from[i] > from[result])
        result = i;
return result;
intmaxIndex(int[] list)
max Index
int bi = -1;
for (int i = 0; i < list.length; i++)
    if (bi == -1 || list[i] > list[bi])
        bi = i;
return bi;
intmaxIndex(int[] shape)
max Index
return shape[0] * Math.max(1, initDimensionMultiples(shape)[0]) - 1;
intmaxIndex(int[] values, int begin, int end)
max Index
int max = Integer.MIN_VALUE;
int index = -1;
if (checkArguments(values, begin, end)) {
    max = values[begin];
    index = begin;
    for (int i = begin; i < end; i++) {
        if (values[i] > max) {
            max = values[i];
...
intmaxIndex(Number[] array)
Returns the (first occurrence of the) index of the cell with the biggest number.
int result;
int i;
double maxValue;
result = -1;
maxValue = -Double.MAX_VALUE;
for (i = 0; i < array.length; i++) {
    if (array[i].doubleValue() > maxValue) {
        maxValue = array[i].doubleValue();
...
intmaxIndex(T[] array)
max Index
int i, max = 0;
for (i = 1; i < array.length; i++) {
    if (array[max].compareTo(array[i]) < 0)
        max = i;
return max;
Integer[]maxIndices(double[] aArray, Integer[] indices)
max Indices
if (value2indices == null) {
    value2indices = new TreeMap<Double, Integer>();
value2indices.clear();
for (int i = 0; i < aArray.length; ++i) {
    if (value2indices.get(aArray[i]) != null) {
        aArray[i] += EPS;
    value2indices.put(-aArray[i], i);
value2indices.values().toArray(indices);
return indices;
ListmaxIndices(int values[])
Finds indices of all maximum values in the given vector
int max = max(values);
List<Integer> retVal = new ArrayList<Integer>();
for (int i = 0; i < values.length; i++) {
    if (values[i] == max) {
        retVal.add(i);
return retVal;
...