[Collection] collection of related simple summary

Collection *
* List (access order, the index can be repeated)
* ArrayList
* underlying array is implemented, thread-safe, quick to find and modify, add and delete slower
* LinkedList
* the bottom of the list is implemented, the threads are not safety, increase and delete faster, find and modify slower
* the Vector
* bottom is the array to achieve, thread-safe, no matter CRUD are slow
* If you find and modify multi-use ArrayList
* If you add and delete multi-use LinkedList
* If you have more, use ArrayList
* the Set (unordered access, no index, can not be repeated)
* HashSet
* underlying hash algorithm
* LinkedHashSet
* bottom is a linked list implementation, but also ensures that the only element, and the same principle HashSet
* TreeSet
* bottom is a binary tree algorithm
* generally do not need to sort the elements in the development of storage, so in most developed using HashSet, HashSet more efficient
* TreeSet more during the interview, ask you several sort way, and some sort of difference
* the Map
* HashMap
* Underlying hash algorithm for key
* LinkedHashMap
* bottom is a list for key
* TreeMap
* bottom is a binary tree algorithm for key
* to develop with more HashMap

Guess you like

Origin www.cnblogs.com/gaoyang666/p/11273151.html