BinarySearch (personal)
#include <stdio.h> struct emp { int no ; int sal ; char name [ 20 ]; }; int binarySearch ( struct emp a [] , int n , int x ) { int low = 0 , mid , high = n - 1 , count = 0 ; while ( low <= high ) { count ++; mid = ( low + high ) / 2 ; if ( x < a [ mid ]. no ) high = mid - 1 ; else if ( x > a [ mid ]. no ) low = mid + 1 ; else { printf ( "no of search = %d \n " , count ); return mid ; } } return - 1 ; } void printArray ( struct emp array [] , int size ) { ...