private int[] mergeEstimators(HyperLogLogPlus other){
  other.mergeTempList();
  int[] tmp=other.getSparseSet();
  mergeTempList();
  int[] set=sparseSet;
  List<Integer> newSet=new ArrayList<Integer>();
  int seti=0;
  int tmpi=0;
  while (seti < set.length || tmpi < tmp.length) {
    if (seti >= set.length) {
      newSet.add(tmp[tmpi++]);
    }
 else     if (tmpi >= tmp.length) {
      newSet.add(set[seti++]);
    }
 else {
      int setVal=set[seti];
      int tmpVal=tmp[tmpi];
      if (getSparseIndex(setVal) == getSparseIndex(tmpVal)) {
        newSet.add(Math.min(setVal,tmpVal));
        tmpi++;
        seti++;
      }
 else       if (getSparseIndex(setVal) < getSparseIndex(tmpVal)) {
        newSet.add(setVal);
        seti++;
      }
 else {
        newSet.add(tmpVal);
        tmpi++;
      }
    }
  }
  return toIntArray(newSet);
}

private int [ ] mergeEstimators ( HyperLogLogPlus other ) { other . mergeTempList ( ) ; int [ ] tmp = other . getSparseSet ( ) ; mergeTempList ( ) ; int [ ] set = sparseSet ; List < Integer > newSet = new ArrayList < Integer > ( ) ; int seti = 0 ; int tmpi = 0 ; while ( seti < set . length || tmpi < tmp . length ) { if ( seti >= set . length ) { newSet . add ( tmp [ tmpi ++ ] ) ; } else if ( tmpi >= tmp . length ) { newSet . add ( set [ seti ++ ] ) ; } else { int setVal = set [ seti ] ; int tmpVal = tmp [ tmpi ] ; if ( getSparseIndex ( setVal ) == getSparseIndex ( tmpVal ) ) { newSet . add ( Math . min ( setVal , tmpVal ) ) ; tmpi ++ ; seti ++ ; } else if ( getSparseIndex ( setVal ) < getSparseIndex ( tmpVal ) ) { newSet . add ( setVal ) ; seti ++ ; } else { newSet . add ( tmpVal ) ; tmpi ++ ; } } } return toIntArray ( newSet ) ; }
merge this hll + + instance with another ! the power of friends ! < p / > this works very similarly to the merge with temp list function . < p / > however , in this case , both lists will need their own delta decoding and neither will have to worry about consuming duplicates .
