binary search in two dimension is based on one dimension binary search