摘要: 1. 理解相等和等价的区别 find方法的“相同”的定义是相等,是以operator==为基础的, set::insert的“相同”的定时则是等价,是以operator < (less)为基础的,即 if(!(v1 < v2) and !(v2 < v1)) 关联容器的等价即为: !(c.key_c 阅读全文
posted @ 2021-10-31 09:35 Kiris 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 使用reserve来避免不必要的重新分配 对于vector和string,增长过程类似于realloc 1.分配一块大小为当前容量... 阅读全文
posted @ 2021-10-30 15:15 Kiris 阅读(26) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <string> #include <list> #include <deque> #include <string> #include <set> #include <map> #include <alg 阅读全文
posted @ 2021-10-30 11:37 Kiris 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 1.六方云(10-21) ```cpp自我介绍C++ 语法左值引用与右值引用有什么区别,左值引用和右值引用的目的是什么虚函数问了好多... 阅读全文
posted @ 2021-10-28 19:54 Kiris 阅读(268) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <string> using namespace std; int binSerach(const std::vector<int>& nums, int target) { int low = 0; in 阅读全文
posted @ 2021-10-26 09:24 Kiris 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;int main(){ vec... 阅读全文
posted @ 2021-10-26 09:23 Kiris 阅读(21) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <string> using namespace std; void mergeSortNum(vector<int>& vec1, int m, vector<int>& vec2, int n) { i 阅读全文
posted @ 2021-10-26 09:23 Kiris 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <string> using namespace std; typedef struct BiTNode{ char ch; //结点数据 struct BiTNode *lchild; //左孩子 str 阅读全文
posted @ 2021-10-26 09:23 Kiris 阅读(56) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int static staticNum = 3; int globalNum = 4; struct staticClass { static int staticClassNUm ; int classNum = 阅读全文
posted @ 2021-10-26 09:23 Kiris 阅读(19) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; void bubleSort(std::vector<int>& vec) { auto size = 阅读全文
posted @ 2021-10-26 09:22 Kiris 阅读(25) 评论(0) 推荐(0) 编辑