Consider the following list. int list[] = {4, 8, 19, 25, 34, 39, 45, 48, 66, 75, 89, 95} When performing a binary search for 75, after the first comparison, the search is restricted to ____.
a) list[0]...list[6]
b) list[0]...list[7]
c) list[5]...list[11]
d) list[6]...list[11]

Respuesta :

ijeggs

Answer:

D) list[6]......list[11]

Explanation:

A binary search finds an item from a list that is sorted, it does this by repeateadly dividing the list by halfs and checking both halfs for the item and discarding the half that does not contain the item until it is narrowed down to the item. The list given contains 12 elements from index 0-11, we are looking for 75 which is at index 9. after the first comparison, since 75 is on the upper half of the list, items from index 0-5 will be discarded.