Discuss Forum

1.

The complexity of Binary search algorithm is ___

  • A. O (n)
  • B. O (n)
  • C. O (n)
  • D. O (n)

Answer: Option B

Explanation:

Binary search runs in at worst logarithmic time, making O ( log n) comparison , where n is the number of elements in the array, the O is Big O notation, and log is the logarithm .

Post your comments here:

Name:
Mobile:
Email:(Optional)

» Your comments will be displayed only after manual approval.