Solved

Suppose We Maintain an Array a of N Int Values

Question 14

Multiple Choice

Suppose we maintain an array A of n int values as follows: A[0] < A[1] < . . . < A[i] > A[i + 1] > A[i + 2] > . . . > A[n - 1]
The ith element is the maximum in the array. What would be the lowest big-Oh notation for finding that element? Consider a variation of the binary search.


A) O(1)
B) O(log2 n)
C) O(n)
D) O(n2)

Correct Answer:

verifed

Verified

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

Related Questions