0

I want to know below objects usage:

HashSet hs = new HashSet();

TreeSet ts = new TreeSet();

Which one is more efficient in real-time scenarios?

Michael Yaworski
  • 13,410
  • 19
  • 69
  • 97
user2173142
  • 39
  • 1
  • 6
  • 2
    Have you read the respective javadocs? – assylias Jan 03 '14 at 06:48
  • Ordering. Unordered will always be more efficient – Paul Samsotha Jan 03 '14 at 06:49
  • 1
    When you were posting this question a whole list of other questions asking this same thing popped up. There is also a list of them on the right of your screen. Please don't ask questions that have already been answered. – takendarkk Jan 03 '14 at 06:52
  • which one is more performer when we retrieve the elements? – user2173142 Jan 03 '14 at 06:53
  • @user2173142 Please try to read JavaDoc before asking a question about a specific class. It usually describes details about its implementation. You should have done this in your other question about `List` vs `LinkedList` as well. – Pavel Horal Jan 03 '14 at 08:40

0 Answers0