Solved

The Method FindMax Shown Below Is Supposed to Return the Position

Question 18

Multiple Choice

The method findMax shown below is supposed to return the position of the largest
Value in the portion of an array between 0 and last,inclusive:
Int findMax(int array[ ],int last) {
Int maxPos = 0;
For (int k = 1;k < = last;k++) {
// Code is Missing
}
Return maxPos;
}
The missing code is


A) if (array[k] > maxPos) return maxPos;
B) if (array[k] > array[maxPos].return maxPos;
C) if (array[k] > array[maxPos].maxPos = k;
D) if (array[k] > array[maxPos].k = maxPos;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents