X601: Debug Code Q3

This method returns the value of the minimum element in the subsection of the array "y", starting at position "first" and ending at position "last".

What is the correct line of code for line 3?

public static int minVal(int[] y, int first, int last) {
  int bestSoFar = y[first];          // line 1
  for (int i=first+1; i<=last; i++)
  {
    if ( y[i] < y[bestSoFar] )       // line 2
      ___                            // line 3
  } // for
  return bestSoFar;                  // line 4
} // method minVal

Your Answer:

Select one answer:

Feedback

Your feedback will appear here when you check your answer.