Binary Search Algorithm

It is an efficient search algorithm that uses a divide and conquer approach. The array is first sorted, and the middle element is compared with the desired item. If they match, the item is found; otherwise, the search is continued in the left or right half of the array.


Time Complexity: O(log n) 


(Hint: Learning Classic Binary Search vs. Modified Search helps with Data Structure and Algorithm Interviews)