Priority queue
1. What is the priority queue??First, the priority queue is a queue. It also has all the properties of the queue.Secondly, the priority queue takes out the element with the highest priority every time.The interior of the priority queue is maintained by heap. Put the highest priority first.2. When will this queue be used??After reading the defin ...
Added by hannah415 on Sun, 23 Jan 2022 10:21:34 +0200
Map collection, hashMap stored procedures, Set collection
1. Map interface
Features of the Map interface
The map collection is structured as key-value pairs, KEY and VALUE, Map. Mapping relationship of Entry<K,V> The key value in map does not allow duplication, if duplicated, the corresponding value will be overwritten Mapping relationships in map s are out of order Maps do not have their ...
Added by jwalsh on Sun, 23 Jan 2022 02:08:17 +0200
Source code analysis of ConcurrentHashMap
6. Membership method
6.1 some auxiliary methods
spread(int h) method
This method is used to calculate the hash value of Node nodes. When calculating the hash value, the high order of h is also used to make the Hash list more scattered.
// 0x7fffffff is converted to binary, which is 11111111111111111111111111111111111111111111111111111111111 ...
Added by Skara on Sat, 22 Jan 2022 22:12:06 +0200
Linked list data structure of Leetcode problem solution
Leetcode solution - linked list
Leetcode solution - linked list
1. Find the intersection of two linked lists2. Linked list inversion3. Merge two ordered linked lists4. Delete duplicate nodes from the ordered linked list5. Delete the penultimate node of the linked list6. Exchange adjacent nodes in the linked list7. List summation8. Palindr ...
Added by gacon on Sat, 22 Jan 2022 20:16:20 +0200
-This article gives you a thorough understanding of arrays and their extended data structures, fast transpose algorithms, etc
published: true date: 2022-1-22 tags: 'algorithm and data structure'
array
This chapter mainly introduces the basic concept and extension of array, and the storage decoupling of special matrices of two-dimensional array: symmetric matrix, triangular matrix, sparse matrix, cross linked list, etc; Then the fast transpose algorithm of sparse ...
Added by ProTec on Sat, 22 Jan 2022 18:53:58 +0200
[PAT (Basic Level) Practice] - [Two Pointers] 1035 insert and merge
I. [Topic difficulty]
Class B
II. [Title No.]
1035 insertion and merging (25 points)
III. [Title Description]
According to the definition of Wikipedia: Insertion sorting is an iterative algorithm, which obtains the input data one by one and gradually produces an orderly output sequence. In each iteration, the algorithm takes an element ...
Added by Jona on Sat, 22 Jan 2022 16:51:22 +0200
Kiner algorithm: deep search (DFS) and wide search (BFS): first understanding the problem state space (hand tearing algorithm)
Guide to series of articles
Guide to series of articles
Open source project
All articles in this series will be included in GitHub for unified collection and management. Welcome ISSUE and Star.
GitHub portal: Kiner algorithm
preface
After understanding the core concept of search algorithm, knowing what problem solving tree is, and masteri ...
Added by scottb1 on Sat, 22 Jan 2022 15:38:33 +0200
Binary tree of data structure
preface
In the process of computer programming, we will use many different kinds of data types, such as number, queue, linked list, etc. each different data type has different data structures. When we contact more data structures, we should have a certain foundation. Let's know the binary tree today.
1, What is a binary tree?
Before ...
Added by gbow on Sat, 22 Jan 2022 12:12:26 +0200
Secondary encapsulation of Java static arrays
Characteristics of array
The biggest advantage of arrays is that they can be queried quickly, because arrays can be queried quickly directly through the index: array[2], so they have certain advantages in random access. Its data structure is a simple linear sequence, which makes element access very fast and it is convenient to traverse the arr ...
Added by outatime88 on Sat, 22 Jan 2022 12:04:32 +0200
Binary tree recursive routine: the lowest common ancestor and the maximum happiness of the party
Today, continue the recursive routine of binary tree.1, Lowest common ancestorGiven the head node of a binary tree and the other two nodes a and b, return the lowest common ancestor of a and b.Definition of lowest common ancestor: A and b look up and find the first same ancestor (this common ancestor may also be a or b itself)1. Recursive routi ...
Added by capb on Sat, 22 Jan 2022 02:20:41 +0200