I need a data structure which works like the STL multiset but the TreeSet in Java doesn\'t allow duplicate elements. Is there any built-in data structure in Java which is eq
You could use a PriorityQueue The elements are sorted in their natural order, or if you provide one, by comparator, and duplicates are allowed.