HashSetVSTreeSetVSLinkedHashSet

https://www.programcreek.com/2013/03/hashset-vs-treeset-vs-linkedhashset/

In brief, if you need a fast set, you should use HashSet; if you need a sorted set, the TreeSet should be used; if you need a set that can be store the insertion order, LinkedHashSet should be used.

Last updated

Was this helpful?