In: Computer Science
You have a collection of unique items which all implement Comparable. The items need to be kept sorted at all times. It is important that the items can be queried for as fast as possible. Which Collection is most suitable?
TreeMap | ||
HashSet | ||
TreeSet | ||
HashMap |