Sorting HashSet without using the tree set?
909741Jan 10 2013 — edited Jan 10 2013Hi,
I need to sort the hash set by using the comparator, if i use the comparator in tree set to sort my hash set then it will check the uniqueness condition also using the same comparator. So i will lose some elements in the set.
So i want to sort no need to check the uniqueness.
Is there any API is available in java to achieve this. Like sorting the list we use the Collections.sort method. Like this any API is available to sort the hash set or any other ways can we achieve this (without using tree set sorting the hash set.)?
Thanks in advance.