Common [memory leak] posture
Focus on the official account [high-performance architecture exploration], dry cargo for the first time; Reply to [pdf] and get classic computer books for free
This article is excerpted from the article: Memory leaks - causes, avoidance, and location
This paper summarizes several common ways of memory leakage. Paying attention to these poin ...
Posted by jasonbullard on Tue, 18 Jan 2022 18:30:18 +0100
Summary of typical minimum spanning tree algorithms~
Classification of minimum spanning tree
🐖: The minimum spanning tree is generally used for undirected graphs, and directed graphs are rarely used. Method selection: Dense graph: using naive Prim algorithm Sparse graph: using Kruskal algorithm Heap optimized Prim is not commonly used!
Plain Prim
The general idea can be referred to Dijk ...
Posted by schme16 on Tue, 18 Jan 2022 17:59:39 +0100
The algorithm enters Dachang from 0 - Part1 - and XOR operation
XOR and XOR
Recognize XOR
int a = 7;
// At this time, the binary of a is 0111
int b = 13;
// At this time, the binary of b is 1101
So now let's turn a XOR b to 10
0 1 1 1
1 1 0 1
-------
1 0 1 0
Officially, it is the same as 0, but different as 1
Simply remember that you want to add directly without carrying
Separate from the same or operat ...
Posted by pit on Tue, 18 Jan 2022 17:39:56 +0100
One book brush questions
All in one book
Stack part
1
http://ybt.ssoier.cn:8088/problem_show.php?pid=1331
it's a very strange prob.I dont know why i cant pass the test in this website while i can pass in sycoj.so i hold the view that its ybt's fault.there's no bugs in my cpp.
Click to view the code
#include<bits/stdc++.h>
#define rep(i,l,r) for(int i=int(l);i< ...
Posted by Dysan on Tue, 18 Jan 2022 17:20:29 +0100
Hash table (general hash table, string hash and Luogu topic P1160 queue arrangement, P4387 [deep foundation 15. Xi 9] verification stack sequence)
Nanchang Institute of technology acm summer training This week I learned the hash table in the data structure and practiced some data structure topics I learned last week Next week, the multi school league will start to learn search and graph theory while making supplementary questions for the competition
General hash table
Definition of h ...
Posted by shezz on Tue, 18 Jan 2022 16:45:53 +0100
[data structure] stack - stack chain (dynamic diagram, c + +, java)
The following is the main body of this article, and the following cases can be used for reference.
Stack chain overview (illustration)
The stack can be stored in sequence or chain, which are called sequence stack and chain stack respectively.
Sequential stack allocates a continuous space and requires two pointers. base points to the b ...
Posted by Sindarin on Tue, 18 Jan 2022 11:01:49 +0100
Stack and queue introduction and basic functions from theory to practice
Content guide
1. Stack
1.1 overview of stack
1.2 several concepts of stack
1.3 characteristics of stack
1.4 examples of stack
1.5 basic functions of stack
1.6 stack classification
1.7 implementation header file of basic functions of sequence stack
1.8 node declaration of sequential stack
1.9 basic function realization and related the ...
Posted by webtechatlantic on Tue, 18 Jan 2022 05:43:40 +0100
Basic data structure -- binary tree
Advantages of binary tree: It can be accessed very efficiently on the binary tree. Binary tree is very suitable for interval operation. A subtree in a binary tree can be regarded as a sub interval of the whole tree. It is very fast to find the interval maximum, interval sum, interval flip, interval merge, interval split, etc. Binary tree is ver ...
Posted by ankycooper on Tue, 18 Jan 2022 02:47:57 +0100
Tree traversal algorithm
1, Several traversal algorithms of tree
1. Preorder traversal
First access the root of T, and then recursively access the root of the subtree. If the tree is ordered, traverse the subtree according to the child's order. The pseudo code for traversing the root of the subtree at position p is:
Algorthm preorder(T, p):
perform the visit act ...
Posted by pbjpb on Mon, 17 Jan 2022 23:52:16 +0100
Programmer code interview guide (written by Zuo Chengyun) learn ing to punch in
catalogue
Chapter 1 stack and queue
CD5 design the stack of getMin function
describe
Realize a stack with special functions, and then realize the operation of returning the smallest element in the stack on the basis of realizing the basic functions of the stack.
Enter Description:
In the first line, enter an integer N, which represe ...
Posted by squariegoes on Mon, 17 Jan 2022 20:15:03 +0100