In java collection framework, which set implementation is fastest, if data retrieval order is not criteria?
any of TreeSet Or LinkedHashSet
HashSet internally uses hash maps to insert and retrieve the data quickly. But it will not promise any order.
HashSet is the most fastest of all other set implementations.
If you are not worrying about the data retrieval order, then use HashSet as it is the most fastest.
Back To Top