Question DSA-SRCH-0079
HardIn Java, Arrays.binarySearch returns −(insertion point) − 1 for a missing key. For key 5 in [1, 3, 7, 9], what does it return?
- A.
2
- B.
−2
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Searching and Binary Search question
In Java, Arrays.binarySearch returns −(insertion point) − 1 for a missing key. For key 5 in [1, 3, 7, 9], what does it return?
2
−2
Sign up free to see the answer and a step-by-step explanation.
−1
−3