What is the best case time complexity of a binary search algorithm? (Best case means given item is in middle position)
O(n log n)
Since in the best case given element is available in middle node. Since in the first while loop only we will find that element is available in middle node. so total no of comparisons are only 1. so complexity is O(1).
Back To Top