Macroscopically understand the content of data structure and have an overall understanding, so that knowledge can be linked and linked into a network. The understanding of knowledge will also be mo
Tag: Data Structure
[Data Structure] SEGMENT TREE
Suppose we now have a very For large arrays, two operations must be performed repeatedly for the numbers in the array.
1, (query) randomly select an interval in this array, and find the sum o
[Data Structure] AVL tree detailed
1. What is an AVL tree? AVL tree is also called balanced binary search tree. It can ensure the relative balance of the height of the binary tree, reduce the height of the binary tree as much as po
[Data Structure] bitmap
Bitmap
#pragma once#include#includeusing namespace std;class BitMap{public: BitMap(size_t range) {_bitMap.resize((range>>5) +1);} void Set(size_t x) { size_t index=x>>5; size_t num =x%32; /*s
[Data Structure] Establish Hufman Tree by Pile
Build a heap
#pragma once #include #include using namespace std;// Small pile templatestruct Less{ bool operator() (const T& l, const T& r) {return l struct Greater{ bool operator() (const T
[Data Structure] Recurrence and non-recursion of the binary tree
The test cases used in the code below are drawn as a tree and look like this:
When creating the tree, the array is given, and’#’ represents an illegal value , That is, the node is empty.
<
[Data Structure] [Status Compression] Brush
Nothing else, I just want to remember those functions by myself
1>floyd+bitset optimization
#include
#include #include span>
using namespace std;
int n;
const int N=2003;
char s
[Data Structure] – Time Complexity and Space Complexity
Before reading this article, it is recommended that you first read [Data Structure]-Macro Understanding, and have a Macro understanding. We usetime complexity and space complexity to analyze the al
[Data Structure] Tree and Binary Tree
Tree
Tree is a typical nonlinear data structure, It can be well applied to data collections that describe branching and hierarchical characteristics. It is a limited collection T composed of
[Data Structure] Pile-based priority queue
#include #include #include#include using namespace std ;templatestruct Big{ bool operator()(const T& l,const T& r) {return l>r; }};templatestruct Less{ bool operator()(const T& l,const T& r) {retur