Interpretation of jdk8 HashMap source code based on Java

HashMap is a Map interface implementation based on hash table. It exists in the form of key value storage, that is, it is mainly used to store key value pairs. Among them, key value can be null, and the mapping is not orderly. The implementation of HashMap is not synchronous, that is, the thread is not safe. 1, Storage characteristics 1.1 ...

Posted by martor on Sat, 08 Jan 2022 17:21:02 +0100

Detailed explanation of the status of ThreadPoolExecutor series

State definition Thread pool ThreadPoolExecutor has two properties: running state and number of threads. The number of threads is easy to understand, that is, how many threads are in the pool; There are five operating states, namely RUNNING: In operation, Is the initial state, that is, the thread pool just created is in this state. SHUTDOWN: ...

Posted by alexcrosson on Sat, 08 Jan 2022 13:24:49 +0100

Algorithm template: prime number bucket of number theory (including detailed explanation of Ehrlich sieve method and Euler linear sieve method) [Shen Qi]

preface Just call me Shen Qi. Recently, I have gained a lot from watching the video of AcWing algorithm basic course. So I decided to open up the algorithm section and officially began to sort out the algorithm notes and clarify my ideas. This time, we brought prime bucket. Hey, hey. Each part will be matched with the corresponding exerci ...

Posted by stezz on Sat, 08 Jan 2022 13:17:40 +0100

Algorithm design and analysis training

Training documents can also be obtained directly at the end of the text Algorithm design and analysis training 1. Title 0-1 knapsack problem 2. Purpose The purpose of course design is to train students to flexibly apply the learned data structure knowledge and independently complete the comprehensive practical ability of the whole proce ...

Posted by jwright on Sat, 08 Jan 2022 10:44:53 +0100

[function development] view program cycle time

requirement analysis On each device, add the programs running on the current device and the list of programs running in history. Click the program list of historical operation to display the cycle time of the clicked program. BU_Machine_CurrProgram At present, the company has arranged 50 devices in the plant area, and there is a scheduled ...

Posted by 88fingers on Sat, 08 Jan 2022 05:17:10 +0100

[learning log] monotone stack monotone queue

Monotone stack Monotone stack is actually to maintain that the sequence in the stack is monotonous. When the element pressed into the monotone stack will break the monotonicity, the element inside will pop up until the monotonicity can be satisfied when the element is pressed into the stack. vector<int>v; stack<int>s; for (int i = ...

Posted by mikejs on Sat, 08 Jan 2022 03:42:23 +0100

Zuo Shen (data structure and algorithm) -- recognize the sorting Day2 of O(NlogN)

preface If violent solutions are used to solve problems, or insert sorting, bubble sorting, etc., and the time complexity is O (n^2), is there a better sorting? Here we will introduce the master formula and merging algorithm in detail, and its time complexity is O(NlogN) Tip: the following is the main content of this article. The follow ...

Posted by xavier.rayne on Fri, 07 Jan 2022 16:55:13 +0100

[learning notes] tree dynamic programming

About tree DP Tree dynamic programming, as the name suggests, is to do dynamic programming on the data structure of the tree. Because the tree is naturally a recursive data structure, the implementation of tree DP is usually memory search. Because there are two types of transfer: push and pull, the transfer of natural tree DP also has two ord ...

Posted by tentaguasu on Fri, 07 Jan 2022 14:34:00 +0100

Ten arithmetic questions are required for an interview. How many will you do?

Recently, a lot of small partners have communicated with me about brushing problems. My advice is to offer and buckle hot100 first. There are still some very important and frequent occurrences in these problems. Today, I share the 10 most frequently occurring arithmetic problems with you, and learn to make money.   0X01 Flip Chain List ...

Posted by emdee on Thu, 06 Jan 2022 18:22:40 +0100

python game development (Snake game, Gobang game, big ball eating small ball game)

catalogue 1, Game development using Pygame 1. Make game window 2. Drawing in a window 3. Load image 4. Achieve animation effect 5. Collision detection 6. Event handling 2, Gobang 3, Snake game 1, Game development using Pygame Pygame is an open source Python module, which is specially used for the development of multimedia applicatio ...

Posted by phillfox on Thu, 06 Jan 2022 15:35:30 +0100