[Kaka on Java] in depth analysis of HashMap source code [key]

   students, today we will deeply analyze the source code of HashMap. I believe many students will be asked about the source code during the interview. Which one is the most asked? Most students will definitely think of HashMap. Through the study of this article, you will be able to easily master the source code knowledge of HashMa ...

Added by KindredHyperion on Wed, 23 Feb 2022 10:33:19 +0200

HashMap source code analysis + interview questions, based on jdk1 8 line by line analysis, this is enough for the interview!

Before reading this article, it is recommended to read the blogger's article on red black tree, which describes the evolution from binary sort tree → AVL tree → red black tree. Transmission address: Quick understanding of red and black trees HashMap source code analysis + interview questions 1, Hash introduction Core theory ...

Added by lingo5 on Sun, 20 Feb 2022 08:43:57 +0200

Data structure: wonderful journey of stack and queue (picture and text show you the charm of stack and queue)

Stack Definition: a stack is a linear table whose insertion and deletion operations are limited to one end of the table. It is usually called the top of the stack and the bottom of the stack. When there are no elements in the table, it is called empty stack. Example: suppose stack S=(a1, a2, a3,... an), then a1 is called the bottom element ...

Added by micbox on Fri, 18 Feb 2022 13:17:53 +0200

Implementation class of Map interface - HashMap

🧭 Implementation class of Map interface HashMap 🚀HashMap HashMap is an implementation class of Map interface, which is displayed in blog Java Map interface We have used HashMap to summarize the commonly used methods. HashMap is the most frequently used implementation class of Map interface.HashMap stores data in the form of key value ...

Added by cl77 on Thu, 17 Feb 2022 22:23:12 +0200

LinkedList source code analysis

ArrayList and LinkedList are succinctly compared: ArrayList has fast query speed and slow insertion (insert in the middle, not at the end), while LinkedList has slow query speed and fast insertion (insert in the middle). What is the reason for their difference? After understanding their underlying implementation, we can know that the underlyin ...

Added by nikkio3000 on Thu, 17 Feb 2022 16:29:49 +0200

Stack and queue oj questions

Stack and queue oj questions [the external chain image transfer fails. The source station may have anti-theft chain mechanism. It is recommended to save the image and upload it directly (img-gqdvgkrh-1644978540376) (E: \ markdown \ note. 1 \ image \ image-20214095416601. PNG)] [the external chain picture transfer fails, and the source stati ...

Added by colB on Wed, 16 Feb 2022 04:38:15 +0200

Summary of single linked list routine

21. Merge two sequential tables Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] There is nothing to say about using an empty node. class Solution: def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode: dummy = ListNode() p = dummy while l1 and l2: if l1.val < l2.val: ...

Added by twister47 on Tue, 15 Feb 2022 15:56:13 +0200

JDK source code series - HashMap implementation principle

1, Introduction HashMap is implemented by hash table, with key/value storage structure. Each key corresponds to a unique value. The speed of query and modification is very fast, and can reach the average time complexity of O(1). It is non thread safe and does not guarantee the storage order of elements; 2, Inheritance class diagram hashMap im ...

Added by Buttero on Sun, 13 Feb 2022 15:47:19 +0200

Data structure and algorithm

Data structure and algorithm 2020 notes 1, Linear structure and nonlinear structure 1.1 linear structure (9.17) Common linear structures: array, queue, linked list, stack Sequential storage structure (array) and chain storage structure, one-to-one linear relationship One-to-one array structure, non-linear array structure, non-linear tree s ...

Added by postalservice14 on Sun, 13 Feb 2022 11:00:19 +0200

Data structure algorithm design problem

Linear table 1. The linear table with known length n adopts sequential storage structure. Write an algorithm to delete all elements with the value of x in the linear table. Method 1: record the number of elements equal to X in the sequence table l with k, count k while scanning L, move the elements not equal to x forward k positions, and fina ...

Added by nahla123 on Fri, 11 Feb 2022 08:53:06 +0200