list双向链表 高效进行插入删除数据 不可以随机存取元素,所以不支持at()和[]操作符。it可以++ --,不能it+5 节点序号从0开始 list<int> l; l.push_back(1);//尾插法 it++; it++; l.inserrt(it,100);//在2号位置插入元素,原来 ...
分类:
编程语言 时间:
2018-09-13 10:19:24
阅读次数:
147
创建vector对象 1.不指定容器大小 vector<int> vec; 2.指定容器大小 vector<int> vec(10); 3.指定容器大小和初始值 vector<int> vec(10,0); 尾部元素扩张 vec.push_back(); 插入元素 1.在最前面插入元素 vec.in ...
分类:
编程语言 时间:
2018-09-12 01:23:14
阅读次数:
206
```C++ class Solution { public: void recur(TreeNode* root, const int expectNumber, int curr, vector>& res, vector& path){ path.push_back(root->val); c... ...
分类:
其他好文 时间:
2018-09-02 20:54:54
阅读次数:
157
存个板子 只能求长度 不知道具体序列 #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define all(a) (a).begin(), ( ...
分类:
其他好文 时间:
2018-08-31 14:48:55
阅读次数:
151
C/C++ code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #include <vector> #include <string> #include <iostream> struct Pe ...
分类:
数据库 时间:
2018-08-27 18:19:36
阅读次数:
155
// list::push_back #include #include class element{ private: int number; public: element(int number){ this->number = number; std::cout number = elemen... ...
分类:
编程语言 时间:
2018-08-18 19:48:19
阅读次数:
142
Hdu1195 两个四位密码 问你最少多少步能到达 /*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define pb push_back using namespace std; typedef l ...
分类:
其他好文 时间:
2018-08-17 21:32:24
阅读次数:
170
#include<bits/stdc++.h> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_back ...
分类:
其他好文 时间:
2018-08-16 20:58:13
阅读次数:
678
void split(const string &s, char delim, vector &elems) { stringstream ss(s); string item; while (getline(ss, item, delim)) { elems.push_back(item); } ... ...
分类:
其他好文 时间:
2018-08-06 19:18:10
阅读次数:
130
莫队模板题,初学莫队感觉分块真是神奇。 1 #include <bits/stdc++.h> 2 using namespace std; 3 #define fst first 4 #define scd second 5 #define pb(x) push_back((x)) 6 #defin ...
分类:
其他好文 时间:
2018-08-03 00:59:32
阅读次数:
165