Answer:
The correct answer to the following question is binary.
Step-by-step explanation:
The binary search is the type of algorithm or program in which the user find their items from the sorted list.
Binary search is the search in the sorted list or an array which is rapidly divided in half interval search.
Steps of the binary search:
- Firstly, read the array or the list of the elements.
- Then, arrange them in the sorted array or the list.
- Then, in the sorted list compare that item which you want to search with the middle element of the array or the list. By using formula:middle_element=(first_element + Last_element)/2
- Then, if both of the elements are same then, you have found that element.
- Then, if the element is not found than we compare that item is greater or the smaller from the middle element.
- Then, if that item is smaller than the middle element than search left side of the sorted list and repeat 2,3,4,5 steps and if not smaller or it is greater than that element than search right side of the sorted list from the middle and repeat 2,3,4,5 steps. by using formula if less than middle: First_element = middle_element + 1, otherwise Last_element = middle_element - 1
- Then, the element is successfully found, if not then that search item is not in the give array or the list of elements.