What is the average-case time complexity of Binary Search?

  • O(1)
  • O(log n)
  • O(n log n)
  • O(n)
The average-case time complexity of Binary Search is O(log n), where 'n' is the number of elements in the array. This is because, on average, Binary Search eliminates half of the remaining elements with each comparison, resulting in a logarithmic growth rate. In the worst-case, it is still O(log n), but in the best-case, it can be O(1) as mentioned in the first question.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *