1.

What is the difference between HashSet and TreeSet in Java?

Answer»
 HashSetTreeSet
1.Offers constant time costOffers log time cost
2.Does not MAINTAIN the order of elementsBy default SORTS elements in ascending order.
3.Implemented USING a hash tableImplemented using BINARY Search Tree


Discussion

No Comment Found