Increment count of numbers having MSB at log ( arr [ i ] )
if ( freq . ContainsKey ( ( int ) ( Math . Log ( Convert . ToDouble ( arr [ i ] ) , 2.0 ) ) ) ) freq [ ( int ) ( Math . Log ( Convert . ToDouble ( arr [ i ] ) , 2.0 ) ) ] ++ ; else freq [ ( int ) ( Math . Log ( Convert . ToDouble ( arr [ i ] ) , 2.0 ) ) ] = 1 ; }