posted 11 years ago
if you really want to know what algorithm is used, then you need to look it up in the source code or google a little. if you just want to know what sorting criteria is applied then javadoc to the rescue:
This class implements the Set interface, backed by a TreeMap instance. This class guarantees that the sorted set will be in ascending element order, sorted according to the natural order of the elements (see Comparable), or by the comparator provided at set creation time, depending on which constructor is used.