private static void shrinkHeap(TreeSet<DoubleDBIDPair> hotset,int k){
  ModifiableDBIDs seenids=DBIDUtil.newHashSet(2 * k);
  int cnt=0;
  for (Iterator<DoubleDBIDPair> i=hotset.iterator(); i.hasNext(); ) {
    DoubleDBIDPair p=i.next();
    if (cnt > k || seenids.contains(p)) {
      i.remove();
    }
 else {
      seenids.add(p);
      cnt++;
    }
  }
}

private static void shrinkHeap ( TreeSet < DoubleDBIDPair > hotset , int k ) { ModifiableDBIDs seenids = DBIDUtil . newHashSet ( 2 * k ) ; int cnt = 0 ; for ( Iterator < DoubleDBIDPair > i = hotset . iterator ( ) ; i . hasNext ( ) ; ) { DoubleDBIDPair p = i . next ( ) ; if ( cnt > k || seenids . contains ( p ) ) { i . remove ( ) ; } else { seenids . add ( p ) ; cnt ++ ; } } }
shrink the heap of " hot " ( extreme ) items .
