Suppose that L is a sorted list of length 1000. To determine whether an item is in L, the maximum number of comparisons executed by the binary search algorithm, as discussed in this book, is ____.a. 1b. 42c. 500d. None of these

Respuesta :

Answer:

a. 1

Explanation:

The length of the array is 1000 named as L.

If we want to find the element from thousand digits using Binary search algorithms, because in binary search we divide the array in two equal parts. After dividing array in two parts, we find that whether the element is in first half or 2nd half.

In Above example the we don't have a specific element that we should compare, so in general only with help of first comparison we find that in array L having 1000, in which half the element is found. As the array divides in 2 parts it should not be named as L having size 1000.

So only comparison is required to find that, the element is in which part of array L.