Wrong answer java doubt

if frequency of 2 strings is same, priority queue should give output in alphabetical order, but it is not giving. I have used the same comparator as used in previous problem. Please check.

see this


commented errors

I stored the elements in queue from highest to lowest. You stored from lowest to highest and reversed it. Please tell the mistake in my approach

also pls explain why order is y,x