Function to perform binary search on a particular column of the 2D array t and b represent top and bottom rows
function binarySearchColumnInc ( arr , col , t , b , x ) { while ( t <= b ) { var mid = parseInt ( ( t + b ) / 2 ) ; if ( arr [ mid ] [ col ] == x ) return mid ; if ( arr [ mid ] [ col ] < x ) t = mid + 1 ; else b = mid - 1 ; } return - 1 ; }