Function to perform binary search on an array sorted in decreasing order
int binarySearchRowDec ( int arr [ ] [ n ] , int row , int l , int r , int x ) { while ( l <= r ) { int mid = ( l + r ) / 2 ; if ( arr [ row ] [ mid ] == x ) return mid ; if ( arr [ row ] [ mid ] < x ) r = mid - 1 ; else l = mid + 1 ; } return -1 ; }