Multiple Choice
The method findLargest examines the elements of an array arr which contains non-negative values
Public static int findLargest(int[] arr)
{
Int curLargest = -1;
For (int i = 0; i < arr.length; i++)
{
If (arr[i] >= curLargest)
{
CurLargest = arr[i];
}
}
Return curLargest;
}
What can you conclude about the running time of this section of code?
A) Its running time will be O(n) .
B) Its running time will be O(n2) .
C) Its running time will be O(log (n) ) .
D) Its running time will be O(n log (n) ) .
Correct Answer:

Verified
Correct Answer:
Verified
Q23: Suppose a developer gets class XYZ files
Q38: Suppose an algorithm requires a total of
Q42: After one iteration of selection sort working
Q43: A version of which sort algorithm is
Q52: If you increase the size of a
Q73: If a call to the Arrays static
Q83: A portion of your program implements a
Q88: If the Arrays static method binarySearch is
Q89: The sort method of the Arrays class
Q94: In the textbook, we found that the