Question DSA-SRCH-0023
EasyBinary search starts with 16 elements. How many halvings reduce the range to a single element?
- A.
8
- B.
4
- C.
Show answer and explanation
Answer: B
16 → 8 → 4 → 2 → 1: four halvings, since 2⁴ = 16.
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 starts with 16 elements. How many halvings reduce the range to a single element?
8
4
Answer: B
16 → 8 → 4 → 2 → 1: four halvings, since 2⁴ = 16.
16
2