Reading the underlying data structure of Redis source code
Redis's extreme encapsulation of the underlying data structure is one of the reasons for redis's efficient operation. We analyze it in combination with redis source code.1, Data type encapsulation of ValueObject structure in Redis: redisObject structuretypedef struct redisObject {
unsigned type:4; // Type of object, string / list ...
Posted by Chief on Sat, 29 Jan 2022 02:43:49 +0100
Binary tree: the maximum and minimum depth of a binary tree
1, Maximum depth of binary tree
Maximum depth of binary tree The maximum depth of binary tree can be achieved by recursion, level traversal and depth first traversal, but the simplest and easiest is recursion.
1. Recursive method
1) Determine the three elements of recursion
Return value and parameters of recursive function: the return ...
Posted by Flinch on Sat, 29 Jan 2022 01:25:28 +0100
IndexTree and AC automata
catalogue
IndexTree
AC automata
IndexTree
Tree array or Binary Indexed Tree (English: Binary Indexed Tree), also named Fenwick tree after its inventor. Its original intention is to solve the calculation problem of Cumulative Frequency in data compression. Now it is mostly used to efficiently calculate the prefix sum, interval sum of ...
Posted by JetJagger on Fri, 28 Jan 2022 20:10:05 +0100
python Programming -- python style Solitaire
python Programming (I) -- python style Solitaire
Python programming style is also called python. This series of articles records learning bits and pieces.
preface
This article is realized through A simple example__ getitem__ And__ len__ Method, the example is to realize 52 playing cards without size kings, including four decors and ...
Posted by allydm on Fri, 28 Jan 2022 18:56:20 +0100
A Leecode every day - find the median of two positive arrays and share with Tencent high-frequency interview questions!
Find the median of two positively ordered arrays
Method 1: binary search
Given two ordered arrays, it is required to find the median of two ordered arrays. The most intuitive ideas are as follows:
Using the merging method, merge two ordered arrays to get a large ordered array. The element in the middle of a large ordered array is the median. ...
Posted by moonshaden on Fri, 28 Jan 2022 17:59:01 +0100
2021-06-20 current account savings management system
Current account savings management system of data structure linked list (C + +)
Current savings account management system
1 question content and purpose requirements (1) Structural background
Linked list is a data structure of linked storage. It uses a group of storage units with arbitrary address to store the data elements in the linear lis ...
Posted by ricardo.leite on Fri, 28 Jan 2022 17:41:59 +0100
HashMap bottom hyperdetailed interpretation
HashMap bottom hyperdetailed interpretation
First, substitute a question: how does the underlying HashMap find the corresponding stored array node through the Key?
Look at the figure first to know what the underlying storage structure of HashMap is like
In the first case, the length of the linked list at the node position of the same array i ...
Posted by DusterG20 on Fri, 28 Jan 2022 17:08:58 +0100
Detailed explanation and summary of the real topic of the 12th Blue Bridge Cup Java group B provincial competition in 2021 [the first provincial competition 2021.04.18]
Detailed explanation and summary of the real topic of the final of the Java group B provincial competition of the Blue Bridge Cup [Topic download, 2013 (4th) ~ 2020 (11th)] CSDN Blue Bridge Cup column
Detailed explanation and summary of the real topic of the 04th Blue Bridge Cup Java group B provincial competition in 2013Detailed explanatio ...
Posted by Wolphie on Fri, 28 Jan 2022 16:44:21 +0100
Take you hand in hand to disassemble the LRU algorithm
Take you hand in hand to disassemble the LRU algorithm
summary
LRU algorithm is a cache elimination strategy. The principle is not difficult, but it is more skilled to write bug free algorithms in the interview. It needs to abstract and disassemble the data structure layer by layer. labuladong in this paper will write you beautiful code. ...
Posted by lakshmiyb on Fri, 28 Jan 2022 15:25:20 +0100
C + + PTA a1098 (insert heap sort)
According to Wikipedia:
Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, and inserts it there. It repeats until no input elements remain.
Heap sort divides its inp ...
Posted by kayess2004 on Fri, 28 Jan 2022 15:02:11 +0100