What does function "fun" do when called with some array x and n = 0?
int fun (int[] x, int n) {
if (n == x.length - 1)
return x[n];
else {
int temp = fun(x, n + 1);
if (temp > x[n])
return temp;
else
return x[n];
}
}
Do you seen any assignments to the array?
Do the comparisons keep the largest or the smallest value?