For practice use only.
Full-Length APCSA MCQ Practice Test 1 - Timed Mode
Full-Length APCSA MCQ Practice Test 1 with a 90-minute timer for AP Computer Science A MCQ pacing practice.
Time left 90:00
Question 1 of 42
Answered 0 of 42
Choose one answer.
Compare the candidate replacements by tracing both a typical input and a boundary input. Account explicitly for index accumulator, indirect comparison, and global versus local minimum. minIndex must return the position of the smallest element of a non-empty array. Which condition replaces /* missing code */ ?
public static int minIndex(int[] a)
{
int best = 0;
for (int i = 1; i < a.length; i++)
{
if (/* missing code */)
{
best = i;
}
}
return best;
}