public static TreeMap<Integer, Integer> countFrequency(TIntIntHashMap freqmap) {
		TreeMap<Integer, Integer> map = new TreeMap<Integer,Integer>();
		TIntIntIterator it = freqmap.iterator();
		while(it.hasNext()){
			it.advance();
			int freq = it.value();
			if(map.containsKey(freq)){
				map.put(freq, map.get(freq)+1);
			}else
				map.put(freq, 1);
		}
		return map;		
	}
public static TreeMap < Integer , Integer > countFrequency ( TIntIntHashMap freqmap ) { TreeMap < Integer , Integer > map = new TreeMap < Integer , Integer > ( ) ; TIntIntIterator it = freqmap . iterator ( ) ; while ( it . hasNext ( ) ) { it . advance ( ) ; int freq = it . value ( ) ; if ( map . containsKey ( freq ) ) { map . put ( freq , map . get ( freq ) + 1 ) ; } else map . put ( freq , 1 ) ; } return map ; }
@param freqmap
@return