Linear search can be more efficient than binary search when the array is _______ or the target element is _______.

  • Large; at the end
  • Small; near the beginning
  • Sorted; at the middle
  • Unsorted; randomly positioned
Linear search can be more efficient than binary search when the array is small or the target element is near the beginning. This is because binary search's efficiency is more pronounced in larger, sorted arrays where it can repeatedly eliminate half of the remaining elements.
Add your answer
Loading...

Leave a comment

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