Do you use any tree with duplicate keys? What can I use from standard containers instead of it?
ps. do not offer jgl.
posted 11 years ago
The Java Collections Framework does not offer a Tree class. However, there are tree implementations of some of the collections that ARE available. These include TreeSet and TreeMap.
However, to answer your question, one possible solution is to use a Map (either HashMap or TreeMap) where the value associated with each key is a List (or Map or Set or any other Collection). You can add the multiple values associated with the key to the List then add the List to the Map.