Java.until.map, set, list information

xiaoxiao2021-03-06  40

Collections => Collection is all the ancestors of all List and set, and list must hold objects in a specific order, and set cannot have repetitive elements ====================== = ArrayList => Using Array Realted List, allowing fast random access, compared with LinkedList is not suitable for elemental settings and removal action LinkedList => Provides optimal step-by-step, suitable for installing and removing elements, random Take action compared to ArrayList slow ================================= Hashset => is a collection, but only the unique value is to look at the search time. Important SET, uses the Hash mode, so Access Time Complexity = O (1) Treeset =>, but the deposited element will be arranged, so the speed is slower than Hashset LINKEDHASHSET => Performance is Likely to Be Just slightly below that of HashSet, due to the added expense of maintaining the linked list, with one exception:. Iteration over a LinkedHashSet requires time proportional to the size of the set, regardless of its capacity Iteration over a HashSet is likely to be more expensive Requiring Time ProPorctional To ITS Capacity. BitSet => Enables high efficiency storage large amount [1/0] (on / off) data ======================= == HashMap => Used to replace HashTable, key / value) PairstreeMap => store (Key / Value) PAIRS, will automatically sort LinkedHashMap => according to the Key value

Performance is likely to be just slightly below that of HashMap, due to the added expense of maintaining the linked list, with one exception: Iteration over the collection-views of a LinkedHashMap requires time proportional to the size of the map, regardless of its capacity . Iteration over a HashMap is likely to be more expensive, requiring time proportional to its capacity. IdentityHashMap => This has better locality for large tables than does using separate arrays.) for many JRE implementations and operation mixes, this class will yield better performance Than Hashmap (Which Uses Chaining Rather Than ", this map, because each value exists only one entity, there is only one entity, and the store is required to search for existing objects in Map. And use the item found (not a re-made one), because this is a tip that saves the storage space, so it is convenient to automatically clean the GC to clean the KEY and VALUE, one but Key is not used, will trigger the cleaning action container 1. Classification of containers 1.1. Collection: A set of separate elements, that is, each of which holds only one element. 1) List: Place an element in the order of elements, and does not rearrange. 2) SET: Do not receive a repetition element, which uses a routing mechanism inside itself 1.2. Map: A group of key-value objects, that is, the HEY-VALUE PAIRS. There is no repetitive key in the map, which has its own internal arrangement mechanism. 2. Element type in the container is Object. When an element is obtained from a container, it must be converted into the original type.

转载请注明原文地址:https://www.9cbs.com/read-117713.html

New Post(0)