What is the time complexity of a binary search on a sorted array?

  • O(1)
  • O(log n)
  • O(n log n)
  • O(n)
Binary search has a time complexity of O(log n) on a sorted array. It efficiently narrows down the search space with each comparison, making it a highly efficient algorithm for searching.
Add your answer
Loading...

Leave a comment

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