Binary Search algorithm is used to find the index of a given element in a sorted array. Lets see the following example: Input: arr[] = {10, 20, 30, 50, 60, 80, 110, 130, 140, 170}
x = 110
Output: 6
Explanation: Element x is present at index 6. Are there any other approach instead of Binary Search? Linear Search…