All pastes #759336 Raw Edit

Something

public text v1 · immutable
·published 2007-11-03 01:26 UTC
rendered paste body
public int max(int[] v) {
        if(v.length > 1) { // At least two values to compare.
            int[] u = new int[v.length - 1];
            for(int i = 1; i < v.length; i++) { // Fill u starting from v[1].
                u[i - 1] = v[i];
            }
            if(v[0] < max(u)) {
                return max(u);
            }
        }
        return v[0];
    }