Java Array Max Value findMax(int[] workArray, int idx)

Here you can find the source of findMax(int[] workArray, int idx)

Description

find Max

License

Open Source License

Declaration

public static int findMax(int[] workArray, int idx) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int findMax(int[] workArray, int idx) {
        return findMax2(workArray, idx, workArray[idx]);
    }/*from   w w w .j  av  a2  s.c om*/

    private static int findMax2(int[] workArray, int idx, int max) {
        if (idx <= 0)
            return max;
        return findMax2(workArray, idx - 1, Math.max(max, workArray[idx - 1]));
    }
}

Related

  1. findMax(double[] u, int startU, int length)
  2. findMax(double[] values)
  3. findMax(int a, int b, int c, int d)
  4. findMax(int[] array)
  5. findMax(int[] v)
  6. findMax(T[] arr)
  7. findMax2(int[] workArray, int idx, int max)
  8. findMaxAbs(float[] array)
  9. findMaxCommonPrefix(String path1, String path2)