posted 15 years ago
Hi all
I understand because the TreeSet return an sorted result. But I dont understand the result given by an iteraction with PriorityQueue. Can anyone help me with this.. please take the example:
This code give the following outputs:
,a,aaa,b,c,d,e,f,g,i,z,zzz
,a,aaa,d,c,b,f,e,i,g,zzz,z
I understood the first line of output, because its from a sorted set (TreeSet). But how about the second output (from PriorityQueue)? Can anyone help me?
Thank you all.