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];
  }
}
It finds the largest value in x and leaves x unchanged.
  • It finds the smallest value in x and leaves x unchanged.
  • It sorts x in ascending order and returns the largest value in x.
  • It sorts x in descending order and returns the largest value in x.
  • It returns x[0] or x[n-1] whichever is larger.

Do you seen any assignments to the array?

Do the comparisons keep the largest or the smallest value?