38.1k views
3 votes
A function that uses the binary search algorithm to search for a value in an array a. repeatedly divides the elements into the number of segments you specify and discards the segments that don’t have the value until the value is found and a pointer to the element is returned b. repeatedly divides the elements in half and discards the half that doesn't have the value until the value is found and a pointer to the element is returned c. repeatedly divides the sorted elements in half and discards the half that doesn't have the value until the value is found and the index of the element is returned d. repeatedly divides the elements into the number of segments you specify and discards the segments that don’t have the value until the value is found and the index of the element is returned

User JiangKui
by
3.6k points

1 Answer

0 votes

Answer:

c. repeatedly divides the sorted elements in half and discards the half that doesn't have the value until the value is found and the index of the element is returned.

Step-by-step explanation:

When binary search is used for algorithm search then the work is searched in the sorted array. There arrays are divided in half and then half of the elements are discarded who does not have value. The search does not completes until it founds the value and index of the element.

User Phuong
by
3.7k points