214k views
0 votes
Question # 5 Multiple Choice Which statement is true? A binary search can only be used on an ordered group of data values. A binary search is always preferred to a linear search. You can use a binary search in every situation where you use a linear search. You can use a binary search on any group of data values.

User Syntaqx
by
5.4k points

2 Answers

10 votes

Answer: Binary Search

Explanation: Other user is correct

User ArunK
by
6.4k points
2 votes

Answer:

A. A binary search can only be used on an ordered group of data values.

Step-by-step explanation:

Binary search is an efficient algorithm used to find an item from a sorted list of items by using the run-time complexity of Ο(log n), where n is total number of elements.

Binary search applies the principles of divide and conquer.

In Computer programming, performing a binary search on an array requires that the array should be sorted in an ascending order i.e from the least to the highest with respect to the data value.

Hence, the true statement is that a binary search can only be used on an ordered (sorted) group of data values.

User Hiroga Katageri
by
6.1k points