Loop to iterate over the elements of the array
for ( int i = 0 ; i < n ; i ++ ) { if ( freq . ContainsKey ( a [ i ] ) ) { freq [ a [ i ] ] = freq [ a [ i ] ] + 1 ; } else { freq . Add ( a [ i ] , 1 ) ; } }