C Program to implement Binary Search

C Program

We are given a sorted array of size n. We have to write program to find an element x in arr[]. In the previous post we have implemented linear search. Now we are going to implement another approach to search it. This approach is called Binary Search. Binary Search – Search an element in sorted […]

Linear Search

Algo Cover

Given an array of n elements. We have to write a function to search an item X in the given array Arr[n] Examples : Input : arr[] = {10, 20, 80, 30, 60, 50,110, 100, 130, 170}x = 110;Output : 6Element x is present at index 6 Input : arr[] = {10, 20, 80, 30, […]

%d bloggers like this: