Binary Search Comparisons for 1024 Elements
Coding
Search
Easy
Hint 1
Each yes/no comparison can at best halve the number of remaining candidate positions.
Hint 2
Find the smallest with .
Show worked solution
1. Relate comparisons to halving the search space
Each comparison partitions the remaining candidates into two roughly equal halves, so comparisons can distinguish at most positions.
2. Solve for k
Since exactly, ten comparisons suffice and are necessary in the worst case.
Answer: 10
Related roles: Browse quant jobs