Question DSA-SRCH-0059
MediumWhat does binary search return if the target is not present and the loop ends with lo > hi?
- A.
Always −1
- B.
The target's index
- 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
What does binary search return if the target is not present and the loop ends with lo > hi?
Always −1
The target's index
Sign up free to see the answer and a step-by-step explanation.
The middle index
lo is the index where the target would be inserted