private int binarySearch(List<SparseItemset> candidates,SparseItemset scratch,int begin,int end){
  --end;
  while (begin < end) {
    final int mid=(begin + end) >>> 1;
    SparseItemset midVal=candidates.get(mid);
    int cmp=midVal.compareTo(scratch);
    if (cmp < 0) {
      begin=mid + 1;
    }
 else     if (cmp > 0) {
      end=mid - 1;
    }
 else {
      return mid;
    }
  }
  return -(begin + 1);
}

private int binarySearch ( List < SparseItemset > candidates , SparseItemset scratch , int begin , int end ) { -- end ; while ( begin < end ) { final int mid = ( begin + end ) > > > 1 ; SparseItemset midVal = candidates . get ( mid ) ; int cmp = midVal . compareTo ( scratch ) ; if ( cmp < 0 ) { begin = mid + 1 ; } else if ( cmp > 0 ) { end = mid - 1 ; } else { return mid ; } } return - ( begin + 1 ) ; }
binary - search for the next - larger element .
