While analyzing source code of a large number of open source Java projects, I found Java developers frequently sort in two ways. One is using the sort()
method of Collections
or Arrays
, and the other is using sorted data structures, such as TreeMap
and TreeSet
.