← Quiz: Searching and Sorting in C: all 10 questions
Quiz: Searching and Sorting in C · Question 2 of 10
At most how many comparisons does binary search need for 1,000 sorted elements?
At most how many comparisons does binary search need for 1,000 sorted elements?
- A.1,000
- B.500
- C.About 10
- D.About 100
Answer & explanation
Correct answer: About 10
2¹⁰ = 1024 ≥ 1000, so about 10 halvings are enough.
Can you get the rest right without peeking?
Take the timed Quiz: Searching and Sorting in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →