A recursive binary search function . It returns location of x in given array arr [ l . . r ] is present , otherwise - 1
static int binarySearch ( int [ ] arr , int l , int r , int x ) { if ( r < l ) return - 1 ; int mid = l + ( r - l ) / 2 ;