TreeSet

TreeSet is an implementation of NavigableSet and so is also a SortedSet and, as a matter of fact, it is also a Set, as the SortableSet documentation implies there are two types of the constructor, each having multiple versions. One requires some Comparator, while the other one relies on the natural ordering of the elements.

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.