question: 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 ++ ; } } }
target:  Shrink the heap of "hot" (extreme) items.