[basic operation summary of binary tree 1]

//Binary tree linked list storage #include<iostream> #include<queue> #include<algorithm> const int N=1e5+10; using namespace std; struct BiNode{ char data; BiNode *lchild,*rchild; }; class BiTree{ private: BiNode* root; public: BiTree(){root=create(root);} ~BiTree(){release(root);} BiNode* getRoot(){return root;} ...

Posted by nano on Sun, 01 May 2022 19:07:09 +0300

[PCL learning: rapid triangulation of disordered point cloud]

catalogue 1. Greedy projection triangulation algorithm 2. class pcl: :GreedyProjectionTriangulation< PointlnT> 3. Test examples The results show that: 1. Greedy projection triangulation algorithm The three-dimensional points are projected to a plane through the normal, and then the projected point cloud is triangulated in the p ...

Posted by Bjblatz on Sun, 01 May 2022 18:26:30 +0300

Class and object end experience

1, Constructor (Advanced) When a class instantiates an object, the compiler will automatically call the constructor of the class and give an initial value to each member variable in the object. 1.1 initial value class Time{ public: Time(int hour,int minute,int second) { _hour = hour; _minute = minute; _second = second; } private ...

Posted by SieRobin on Sun, 01 May 2022 17:23:21 +0300

Use the Native Debug extension of VSCode to debug the integrity library

VSCode has an extension called Native Debug, which is very convenient for program debugging. This paper describes how to use this extension, taking C/C + + as an example. The running environment is Win10 and the compiler is mingw gcc 9.2.0, which needs to be installed in advance. I. install Native Debug Search for native in the VSCode exte ...

Posted by BizLab on Sun, 01 May 2022 13:01:47 +0300

Machine test questions for graduate students of Central South University

The topics are incomplete and in no order 1. Benefiting the people Title Description The goal of the municipal government's "benefiting the people project" is to set up gas pipelines between N residential areas in the city (but not necessarily connected by direct pipelines, as long as they can be reached indirectly through pipel ...

Posted by ddrummond on Sat, 30 Apr 2022 11:43:54 +0300

Depth and breadth first traversal of Graphs

First introduce the structure of two kinds of graphs Adjacency matrix: A one-dimensional array is used to store the vertices in the graph, a two-dimensional array is used to represent the relationship between elements, and the row, column and their values are used to represent whether there is an edge (ARC) between the two vertices. If the va ...

Posted by matthewlesh on Sat, 30 Apr 2022 04:43:12 +0300

C + + cast const_cast,static_cast,dynamic_cast,reinterpret_cast ,dynamic_cast

Recall the C language's cast Format First:    this old-fashioned cast is not clear enough in terms of expression and easy to be missed. Once there is a problem in the conversion process, it will be more difficult to track. In order to solve the above problems, C + + is not only compatible with C's forced conversion, but also intr ...

Posted by bretx on Fri, 29 Apr 2022 17:36:40 +0300

OpenCV basic learning

1: Display image and save #include<opencv2/opencv.hpp> #include<iostream> using namespace std; using namespace cv; int main() { Mat src = imread("D:/images/011.jpg",IMREAD_GRAYSCALE);//The data read in is based on the situation of the matrix, and the second parameter represents the display of a gray image. if (src.empty()) ...

Posted by syamswaroop on Fri, 29 Apr 2022 06:25:40 +0300

The sort function in stl, do you really understand?

foreword The sort method is prepared for some containers in stl, but do you really understand him? First, what algorithm does the sort method use to sort? If you answer: The sort algorithm in STL must use quick sort? Is it still bubble sort? If you just answered Quick Sort, then congratulations you only got 33.333% correct, which is a ...

Posted by tobias on Fri, 29 Apr 2022 02:32:46 +0300

C + + Runtime Type Identification (a new feature of C + +)

Compile time overhead When compiling code, the compiler mainly carries out lexical analysis (identifying words, confirming parts of speech: identifiers, keywords, strings, numbers, etc.), syntax analysis (identifying the grammatical attributes of phrases and sentence patterns, generating syntax trees), semantic analysis (confirming the semanti ...

Posted by Dillinger on Fri, 29 Apr 2022 00:43:23 +0300