Data Structures(Binary search in Data structures)
Binary Search 👉 Binary search is the search technique which works efficiently on the sorted lists. 👉 Hence, in order to search an element into some list by using binary search technique, we must ensure that the list is sorted. 👉 Binary search follows divide and conquer approach in which, the list is divided into two halves and the item is compared with the middle element of the list. 👉 If the match is found then, the location of middle element is returned otherwise, we search into either of the halves depending upon the result produced through the match. 👉 Binary search is implemented using following steps... Step 1 - Read the search element from the user. Step 2 - Find the middle element in the sorted list. Step 3 - Compare the search element with the middle element in the sorted list. Step 4 - If both are matched, then display "Given element is found!!!" and terminate the function. Step 5 - If both are not m...