AP Computer Science Amediummcq1 pt

To find the maximum value in an int array, you

A.keep the largest value seen and update when a bigger one appears
B.sort the array first
C.take a[0] always
D.take the last element

Explanation

Core Concept

Scanning tracks the running max.

Correct Answer

Akeep the largest value seen and update when a bigger one appears

More Unit 6: Array practice questions

Try a random question →

Practice more AP Computer Science A questions with full explanations

Practice Unit 6: Array Questions →