Can binary search be applied to non-sorted arrays? Explain why or why not.

  • No, binary search relies on the array being sorted
  • No, binary search will give incorrect results
  • Yes, binary search will work the same way
  • Yes, but with reduced efficiency
Binary search requires a sorted array to make decisions about the search direction. If the array is not sorted, the algorithm cannot reliably determine which half of the array the target might be in, leading to incorrect results.
Add your answer
Loading...

Leave a comment

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