Collection, generic, List, Collections, Set, Map

Collection, generic, List, Collections, Set, Map 1, Collection collection 1.1 collection overview Collection: a collection is a container provided in java that can be used to store multiple data. Differences between sets and arrays: The length of the array is fixed. The length of the collection is variable.The elements of the same type are ...

Added by sethcox on Mon, 03 Jan 2022 03:51:41 +0200

Detailed explanation of red and black trees in HashMap

HashMap in Java uses the linked list method to solve hash conflicts. The HashMap principle is that key value pairs with the same bucket subscript are stored in a linked list. When the linked list becomes longer, searching and adding (you need to determine whether the key already exists) need to traverse the linked list, and the speed will becom ...

Added by *mt on Thu, 23 Dec 2021 03:21:57 +0200

The HashMap hashing principle that cannot escape the interview must be understood this time

1. Preface HashMap is definitely the essence of JDK source code. In addition, there are AQS, thread pool and so on. However, because HashMap is the earliest and most contacted by us, its existence is absolutely indispensable in the interview eight part essay. If you want to learn a technology, you can probably understand its principle. In ...

Added by Ozzmosis on Sun, 19 Dec 2021 17:31:47 +0200

HashMap implementation principle (with source code), see this article is enough

HashMap is a collection container that senior java engineers must be proficient in. Its importance is almost equal to the importance of Volatile in concurrent programming (visibility and order). Through the detailed explanation of graphic source code, this article deeply analyzes the important kernel knowledge of HashMap, which is easy to read ...

Added by catalin.1975 on Tue, 14 Dec 2021 01:08:14 +0200

The most detailed source code analysis for HashMap and Concurrent HashMap of Java base collection classes

HashMap Source Analysis HashMap is a common key-value collection implementation class in Java that implements the Map interface. data structure Core: The whole is an array;Each position of the array is a chain list (or a red-black tree);The Value in each node of the list is the Object we store; JDK 1.7 data structure Array+Chain List ...

Added by plapeyre on Fri, 19 Nov 2021 19:55:24 +0200

2021-11-07 HashMap operation, summarize

Check every HashMap operation, and finally take the time to summarize it 1, Basic operation of HashMap 1. Create HashMap<Integer,String> map = new HashMap<>(); 2. Add //Time complexity O(1), obtain the memory address through the hash function, and then put it into memory //map.put(key,value) map.put(1,"lihua"); 3. Renew map. ...

Added by trent2800 on Mon, 08 Nov 2021 00:01:38 +0200

Deep parsing HashMap set underlying principle

Pre knowledge # ==The difference between and equals # For basic type variables, you can only use = =, because basic type variables have no methods. Use = = value comparison For variables of reference type, whether the addresses of the two reference objects compared by = = are equal. All classes inherit from the object class, and the object c ...

Added by dhodge on Fri, 29 Oct 2021 07:23:25 +0300

Record a written test in grape city

Title Source: Title website: https://www.grapecity.com.cn/career/challenge Title Description: Title: Data Visualization Programming language: Unlimited Title Description: there is a saying: "the text is not as good as the table, and the table is not as good as the picture". It vividly describes the different eff ...

Added by jellis on Sun, 05 Sep 2021 03:56:52 +0300