Detailed explanation of heap and code implementation of Binary Heap

catalogue 1, Definition and introduction of heap 2, How to store binary heap with array? 3, Insert an element into the maximum heap Shift up 4, Remove the element from the maximum heap Shift Down 5, Summary 1, Definition and introduction of heap Heap is a special data structure in computer science. A heap is usually an array object ...

Added by j_70 on Sun, 16 Jan 2022 19:51:47 +0200

List of data structures of konjaku

List of data structures of konjaku If there is a list of the embodiment of human great wisdom in the world, the data structure must have a place in it. This article is just a summary of the author's study of data structure. Because most of them have learned it, they don't explain it in detail. Only a few points that can slightly increase unde ...

Added by JonathanV on Sun, 16 Jan 2022 18:51:45 +0200

01 redis core data structure and high performance principle

Important thing to say: every word is knocked by pickup hand. I hope you can read and understand pickup's thoughts when writing a blog word by word. I hope you have something to gain, thank you! This is the first article about redis, because redis plays an important role in our work. Later, I will write about the persistence of redis, the ...

Added by cornercuttinjoe on Sun, 16 Jan 2022 18:39:28 +0200

leetcode brush questions / daily questions 138 Copy linked list with random pointer

138. Copy linked list with random pointer Meaning: Give you a linked list with a length of n. each node contains an additional random pointer random, which can point to any node or empty node in the linked list. Construct a deep copy of this linked list. The deep copy should consist of exactly n new nodes, in which the value of each new ...

Added by MasumX on Sun, 16 Jan 2022 16:32:11 +0200

Data structure and algorithm analysis - queue

summary Baidu Encyclopedia: Queue is a special linear table, which only allows deletion at the front of the table and insertion at the back of the table. Like stack, queue is a linear table with limited operation. The end that performs the insertion operation is called the tail of the queue, and the end that performs the deletion operation ...

Added by MadnessRed on Sun, 16 Jan 2022 12:23:15 +0200

[algorithm question - Sword finger Offer] detailed analysis: image of binary tree and stack containing min function

Image of JZ18 binary tree (simple) subject describe Operate the given binary tree and transform it into a mirror of the source binary tree. For example: source binary tree     8   /     \ 6     10 / \     /   \ 5 7   9  11 Mirror binary tree      8   /      \ 10     6 / \      /  \ 11 9  7 5 Example Input: {8,6,10,5,7,9,11} Return ...

Added by danoli3 on Sun, 16 Jan 2022 10:03:56 +0200

Container adapter -- queue, stack, priority_queue

What is an adapter adapters play the role of bearing and converter in the flexible combination and application function of STL components. The concept of adapter is actually a design pattern. In the design pattern, the definition of adapter style is as follows: convert one class interface into another class interface, so that classes that ...

Added by slyte33 on Sun, 16 Jan 2022 07:00:39 +0200

LeetCode -- Target Sum -- backtracking algorithm and dynamic programming -- alloc and mismatch -- the best explanation for non aftereffect and repetitive subproblems

Title Description You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers. For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build th ...

Added by cahamilton on Sun, 16 Jan 2022 01:31:57 +0200

Data structure - linear table

Linear table brief introduction Linear table(List):A finite sequence of zero or more data elements Sequential storage structure /*Sequential storage*/ constexpr auto MAXSIZE = 20; constexpr auto OK = true; constexpr auto ERROR = false; ElemType GetElem(SqList L, int i, ElemType* e);//Read element ElemType ListInsert(SqList* L, int i, ...

Added by JeDi58 on Sat, 15 Jan 2022 23:39:46 +0200

C language error set

PTA exercise 2-6 calculate the free falling distance of an object (5 points) An object falls freely from an altitude of 100 meters. Write a program to find the vertical distance it falls in the first 3 seconds. Let the gravitational acceleration be 10 m / S2. Input format: This topic is not entered. Output format: Output in the followi ...

Added by delhiris on Sat, 15 Jan 2022 17:42:35 +0200