Add all the strings and their corresponding values to the priority queue
for ( int i = 0 ; i < n ; i ++ ) { Priority x = new Priority ( ) ; x . s = str [ i ] ; x . count = num [ i ] ; p . add ( x ) ; }