Question DSA-SRCH-0022
EasyBinary search looks for 11 in [1, 3, 5, 7, 9, 11, 13]. Which element is compared first?
- A.
5
- B.
9
- C.
Show answer and explanation
Answer: C
The middle of indices 0–6 is index 3, which holds 7.
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
Binary search looks for 11 in [1, 3, 5, 7, 9, 11, 13]. Which element is compared first?
5
9
Answer: C
The middle of indices 0–6 is index 3, which holds 7.
7
11