Question discussion

What is the maximum number of comparisons needed by binary search in a sorted array of 1024 elements?

1134Medium DSSSB TGT Computer Science 0 replies 1 views
0

What is the maximum number of comparisons needed by binary search in a sorted array of 1024 elements?

  • A9
  • B10
  • C1024
  • D11
Correct answer: D

Explanation

The worst case is ⌊log₂ n⌋ + 1 = 10 + 1 = 11 comparisons.

Discussion 0

Nobody has replied yet. Start the discussion!