Calculate log of the current array element
int lg = ( int ) ( Math . log ( freq . get ( key ) / Math . log ( 2 ) ) ) ; int a = ( int ) Math . pow ( 2 , lg ) ; int b = ( int ) Math . pow ( 2 , lg + 1 ) ;