0
/ 2.0
This method returns the value of the minimum element in the subsection of the array "y", starting at position "first" and ending at...
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 feedback will appear here when you check your answer.