2018年9月28日 星期五

[Java] Set Implementations

Documents: https://docs.oracle.com/javase/tutorial/collections/implementations/set.html


There are three general-purpose Set implementations:
  • HashSet
    • No ordering guarantees.
  • TreeSet
    • Implements SortedSet interface
  • LinkedHashSet
    • Differs from HashSet in that it maintains a doubly-linked list running through all of its entries. 
    • This linked list defines the iteration ordering, which is the order in which elements were inserted into the set (insertion-order).

There are two special-purpose Set implementations:
  • EnumSet
  • CopyOnWriteArraySet

沒有留言:

張貼留言