Here you can find the source of findMax(int[] workArray, int idx)
public static int findMax(int[] workArray, int idx)
//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])); } }