The following is a recursive function that determines whether a given integer array
is sorted or not. It is missing one line of code, which is a return statement
in the recursive case of the code. Complete the function by supplying this missing
line of code.
public static boolean isSorted(int[] data, int n)
{
// base case
if(n == 1)
return true;
else
{
// Recursive case
boolean temp = isSorted(data, n-1);
// Here is the missing line of code
return (temp) && (data[n-2] <= data[n-1]);
}
}