Ags Karan wrote:LinkedHashSet - ordered by insertion order(Exceptional case where ordered but still cannot be sorted )
You can't say LinkedHashSet can't be ordered. Since it implements Collection but not List, so it doesn't allow index based access/insertion. So it won't be easy to sort it. But since it maintains insertion order, you can always sort it. You'll have to put some extra effort, you can find the smallest element, remove it and add it at the end, then 2nd smallest and remove-then-insert it at the end, then 3rd smallest and so on...