Experience in using stl container
1. The associated container implements its own comparison type
We often define a container.
vector<int> vec;
In fact, this is the abbreviation of the following function.
vector<int, less<int>> vec;
vector<int, less<int>, allocator<int>> vec;
It is only the default. The default size comparison function ...
Added by speckledapple on Fri, 08 Oct 2021 07:40:18 +0300
The Foundation of C + + -- notes based on C++ Primer I
The notes are based on C++Primer(5th Edition) and use C++11 standard
Because the author is a beginner, the content will not be comprehensive
If there is any mistake, please point it out directly
-2021.7
According to the content of C++ Primer, the notes will be divided into four parts:
C + + Basics C + + standard library Class design Other ...
Added by w4seem on Thu, 07 Oct 2021 21:24:11 +0300
C + + tutorial (most complete)
1 Introduction to C + +
1.1 origin1.2 scope of application1.3 C + + and C 2 development tools3 basic grammar
3.1 notes3.2 keywords3.3 identifier 4 data type
4.1 basic data type4.2 space occupied by data types in different systems4.3 typedef declaration4.4 enumeration types 5 variables
5.1 declaration and definiti ...
Added by neptun on Thu, 07 Oct 2021 21:18:17 +0300
Getting Started with 0 Notes [National Excellent C ourse]
C Language Programming
All code shows the code inside the main function
Computer thinking
Rolling-Rotating Division
int u = 32;
int v = 32;
//If v=0, at the end of the calculation, u is the greatest common divisor
//v!=0 calculates the remainder of u/v so that u=v=the remainder
while(v!+0)
{
int temp = u%v;
u = v;
v = temp;
}
print ...
Added by neex1233 on Thu, 07 Oct 2021 19:37:41 +0300
C + + problem brushing -- C + + function and program structure
1. Are the following function definition statements correct?
(a)
void fun1(int i,int j);
{
cout<<i+j;
}
(b)
void fun1(int i,int j)
{
void fun2()
{
cout<< "This is fun2. "<<endl;
}
cout<<i+j;
}
(c )
void fun1(int i,int j)
{
cout<<i+j;
return 1;
}
(d)
void fun1(int i,int j)
{ ...
Added by James138 on Thu, 07 Oct 2021 07:11:50 +0300
LeetCode question 98 -- verifying binary search tree
This article will share the solution ideas and steps of LeetCode question 98 in detail, hoping to bring help to you.
preface
Binary tree is a very important data structure. It involves a wide range of algorithms. Whether it is an amazing backtracking algorithm or an amazing dynamic programming, it is closely related to binary tree, whic ...
Added by geaser_geek on Thu, 07 Oct 2021 03:38:15 +0300
Greedy algorithm special algorithm exercise 1
Greedy algorithm (English: greedy algorithm), also known as greedy algorithm, is an algorithm that takes the best or optimal (i.e. the most favorable) choice in the current state in each step of selection, hoping to lead to the best or optimal result. Take a simple example, that is, change. For example, you need to give customers 85 yuan in cas ...
Added by mpar612 on Wed, 06 Oct 2021 18:29:16 +0300
Learning notes of c + + Advanced Programming 7
Learn more about template parameters
In fact, there are three template parameters: type parameter, non type parameter and template template parameter (there is no repetition here, which is indeed the name). Chapter 12 lists examples of type parameters and non type parameters, but I haven't seen the template parameter. This chapter also has som ...
Added by antwonw on Tue, 05 Oct 2021 05:17:52 +0300
Algorithmic Notes Reading Record DAY_18
CHAPTER_6 C++STL correlation
6.3 string
In the c language, we use char arrays to store strings, which can be cumbersome. Therefore, adding a string type to STL makes it easier for us to manipulate strings. To use a string, you need to add a header file #include <string>.
string's usage is recorded in Algorithmic Notes P202-P209. Mo ...
Added by Quevas on Sun, 03 Oct 2021 23:10:09 +0300
ndnSIM learning -- super detailed analysis of ndn-simple.cpp of examples
preface
Since I am still a senior and a beginner of ndnSIM, I will inevitably make many mistakes in the article. I hope beginners don't believe it when they see this article. You are also welcome to correct my article!
code analysis
Firstly, start with the simplest ~ / newndnSIM/ns-3/src/ndnSIM/examples/ndn-simple.cpp to analyze the whol ...
Added by -Karl- on Sun, 03 Oct 2021 23:03:40 +0300