Implementation of JavaScript linked list
Linked list
Linked list concept
Linked list: a storage structure of data. A linked list contains several nodes. Each node contains at least one data field and one pointer field, and the pointer field points to the next node. Node: the storage image of the data element, which is composed of the data field storing the data element and the p ...
Added by dsds1121 on Mon, 31 Jan 2022 20:58:47 +0200
UTHash Use Tutorial
UTHash Use Tutorial
quick get start
To get started with this module, visit: Introduction, Data Interface, Sample Code
introduce
Hash: Hash, accessed by mapping data to a location in memory storage through functions on key values. This process is called Hash, a mapping function called a hash function, and an array of records is called a hash ...
Added by PHPFreaky on Mon, 31 Jan 2022 20:51:19 +0200
Linked list exchange and sorting
Linked list exchange and sorting
1. Given a linked list, two adjacent nodes are exchanged, and the exchanged linked list is returned.
Example: given 1 - > 2 - > 3 - > 4, you should return 2 - > 1 - > 4 - > 3
explain:
Your algorithm can only use the extra space of constants.You can't simply change the value inside the node, ...
Added by MadDogSh on Mon, 31 Jan 2022 17:30:28 +0200
[interview questions] width first search
[interview questions] width first search
1, The most concise general template of BFS algorithm
1. BFS templates for trees and graphs
new ArrayDeque is recommended for queues, and new LinkedList is not recommended (linked list is slower than array)
//Double ended queue
Queue<Node> queue = new ArrayDeque<>();
HashMap<Node,Integer ...
Added by lamajlooc on Mon, 31 Jan 2022 15:30:03 +0200
A problem that beginners can! But how many can you write? "Suggest collecting slow goods!"
preface
Wallpaper recommendation
If you have any right, please contact me for deletion
Blogger profile
Blogger introduction:
– I am a fan. The meaning is that I hope I will put kindness first and character first at any time. I like the four training of life setting, the method of correction, the way of accumulating kindne ...
Added by Fuzzylr on Mon, 31 Jan 2022 13:26:25 +0200
Introduction to algorithm - array, linked list, selection and sorting
catalogue
How memory works
Arrays and linked lists
array
Linked list
Compare
Overall comparison
Time complexity
Implementation of linked list in python
test
Select sort
Summary
How memory works
When you go to the supermarket, you should see a storage cabinet at the door. When you go to the supermarket, you store your things in t ...
Added by beboni on Mon, 31 Jan 2022 12:27:39 +0200
Dynamic programming: interval d p summary
1, Interval dp
As the name suggests, interval dp is the problem of solving the optimal value on the interval.
The main idea is to solve the inter cell first, and then use the optimal solution combination between cells to obtain the optimal solution of the maximum interval.
If you don't say much, go straight to the example:
Classic example: ...
Added by greenba on Mon, 31 Jan 2022 12:08:53 +0200
Sorting algorithm in data structure -- quick sorting -- basis of C language
Quick sort is an exchange sort method of binary tree structure proposed by Hoare in 1962. Its basic idea is: any element in the element sequence to be sorted is taken as the reference value, and the set to be sorted is divided into two subsequences according to the sort code. All elements in the left subsequence are less than the reference valu ...
Added by neil.johnson on Mon, 31 Jan 2022 12:07:17 +0200
Java crack 9X9 Sudoku games
background
Recently, I brushed this interesting topic on LeetCode and thought of my love for Sudoku in junior high school. I couldn't help feeling very much. It turns out that this program can produce results in less than 1m, which made me waste so much time to study before.
effect
It is said that this is the most difficult Sudoku topic [cli ...
Added by sabbagh on Mon, 31 Jan 2022 09:15:13 +0200
Detailed explanation of binary tree and typical questions of force buckle
1, Types of binary trees
1. Full binary tree
Except that the last layer has no child nodes, all nodes on each layer have two child node binary trees (if the depth is k, there are 2^k-1 nodes).
2. Complete binary tree
Let the depth of a binary tree be H. Except for layer h, the number of nodes in other layers reaches the maximum, and all n ...
Added by xxxzom_biexxx on Mon, 31 Jan 2022 08:43:07 +0200