0%
0 / 5 answered

Implementing Array Algorithms Practice Test

5 Questions
Question
1 / 5
Q1

Given the following array, find the index of the first occurrence of target using binary search on a sorted array that may contain duplicates. Input: sorted int[] a ($0 \le n \le 10^5$), int target. Output: smallest index i with ai==target, else -1. Example: a=1,2,2,2,5, target=2 -> 1. Which method is correct?

Question Navigator