Question: If upperBound and lowerBound are called on the same array to search for the same value, like this: int idx 1 = BinarySearch.lowerBound ( a
If upperBound and lowerBound are called on the same array to search for the same value, like this:
int idx BinarySearch.lowerBounda value;
int idx BinarySearch.upperBounda value;
and the returned indices are the same that is idx idx then which of these is true?
There are no elements of a that are equal to value.
This can't happen; it is impossible for idx and idx to be equal.
There is exactly one element of a that is equal to value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
