10 2021 档案

摘要:1. 理解相等和等价的区别 find方法的“相同”的定义是相等,是以operator==为基础的, set::insert的“相同”的定时则是等价,是以operator < (less)为基础的,即 if(!(v1 < v2) and !(v2 < v1)) 关联容器的等价即为: !(c.key_c 阅读全文
posted @ 2021-10-31 09:35 Kiris 阅读(46) 评论(0) 推荐(0)
摘要:使用reserve来避免不必要的重新分配 对于vector和string,增长过程类似于realloc 1.分配一块大小为当前容量... 阅读全文
posted @ 2021-10-30 15:15 Kiris 阅读(35) 评论(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 阅读(75) 评论(0) 推荐(0)
摘要:1.六方云(10-21) ```cpp自我介绍C++ 语法左值引用与右值引用有什么区别,左值引用和右值引用的目的是什么虚函数问了好多... 阅读全文
posted @ 2021-10-28 19:54 Kiris 阅读(308) 评论(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 阅读(21) 评论(0) 推荐(0)
摘要:#include #include #include using namespace std;int main(){ vec... 阅读全文
posted @ 2021-10-26 09:23 Kiris 阅读(28) 评论(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 阅读(40) 评论(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 阅读(69) 评论(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 阅读(29) 评论(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 阅读(33) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <string> #include <unordered_map> #include <mutex> #include <thread> using namespace std; // vector<int 阅读全文
posted @ 2021-10-26 09:21 Kiris 阅读(38) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <string> #include "stdlib.h" #include "stdio.h" using namespace std; #define NULL 0 #define LEN sizeof( 阅读全文
posted @ 2021-10-26 09:21 Kiris 阅读(54) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <string> #define sum(a,b,c) a+b+c using namespace std; int a = 3; int main() { // int *p = NULL; // int 阅读全文
posted @ 2021-10-25 21:43 Kiris 阅读(74) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> //节点结构体 struct msg { int num; //数据区 struct msg *next; //链表区 }; struct 阅读全文
posted @ 2021-10-25 21:41 Kiris 阅读(39) 评论(0) 推荐(0)
摘要:#include<stdio.h> #include<malloc.h> #include<unistd.h> int bss_var; int data_var0=1; int main(int argc,char **argv) { printf("below are addresses of 阅读全文
posted @ 2021-10-25 21:40 Kiris 阅读(23) 评论(0) 推荐(0)
摘要:#include <stdlib.h> #include <stdio.h> #include <algorithm> #include <iostream> #include <string> using namespace std; /* 实现itoa函数 int to array */ cha 阅读全文
posted @ 2021-10-25 21:38 Kiris 阅读(272) 评论(0) 推荐(0)
摘要:#include #include using namespace std;int main(){ const char p... 阅读全文
posted @ 2021-10-25 21:37 Kiris 阅读(27) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int midFactor1(int n) { vector<int> factors; for(int 阅读全文
posted @ 2021-10-25 21:36 Kiris 阅读(34) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <mutex> #include <memory.h> using namespace std; int e = 6; int getNum() { return 5; }; int main() { in 阅读全文
posted @ 2021-10-25 21:34 Kiris 阅读(38) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <string.h> using namespace std; int main() { char *p1 = "0123+%"; char p2 = '0123+%'; char *p5; p5 = &p 阅读全文
posted @ 2021-10-25 21:32 Kiris 阅读(16) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include <string.h> using namespace std; int isSpace(char x) { if(x == ' ' or x == '\t' or x == '\n') { return 1 阅读全文
posted @ 2021-10-25 21:29 Kiris 阅读(22) 评论(0) 推荐(0)
摘要:#include #include using namespace std;struct Node{ int data; ... 阅读全文
posted @ 2021-10-25 21:20 Kiris 阅读(60) 评论(0) 推荐(0)