The complex of Binary search alogrithm is___
A
O(n)
B
O(log n)
C
O(n2)
D
O (n log n)
Correct Answer: O(log n)
Binary search, also known as half - interval search or logarithmic search is a search algorithm that finds the position of a target value within a sorted array. In Binary search algorithm, worst case performance is O(logn), Best case performance is O(1).