If a sorted array contains 1024 elements, approximately how many divisions are required in the worst case by binary search?
Options
- A. 5
- B. 10
- C. 512
- D. More than one of the above
- E. None of the above
Quiz Practice:
B. 10
Binary search divides the search space by two at every step. Since 210 = 1024, approximately 10 divisions are required to reduce a search space of 1024 elements to one element. This illustrates the O(log2N) complexity of binary search. The exact number of comparisons can depend on implementation and whether the target is encountered before the search reaches a single remaining element.