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.
Loading...
Related Quiz
- Selection sort's time complexity can be improved to _______ by implementing certain optimizations.
- What are some optimizations that can be applied to improve the efficiency of the Edit Distance algorithm?
- In DFS, _______ is used to mark nodes as visited.
- Bubble sort is not recommended for large datasets due to its _______ time complexity.
- One of the key advantages of merge sort is its _______ time complexity in all cases.