摘要: #include<iostream> #include<map> #include<algorithm> using namespace std; void func(pair<int, char> t) { cout << "key: " << t.first << " value: " << t 阅读全文
posted @ 2018-10-03 15:17 清浅...忆回 阅读(69) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<algorithm> #include<list> using namespace std; struct Node { char a; int b; }; void func(Node &t) { cout << t.a << " " << 阅读全文
posted @ 2018-10-02 17:05 清浅...忆回 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 两个div设置行内块属性,内外边距已经设置为0了,但是两个div之间为什么还有间隙呢?修改如下 将body中的连个div设置为一行就可以了。 阅读全文
posted @ 2018-10-02 10:30 清浅...忆回 阅读(228) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; struct STU { int a; }; int main() { vector<int> vec1; //vector 中的结构可以是C C++所有的基础类型 vector<cha 阅读全文
posted @ 2018-09-18 21:49 清浅...忆回 阅读(93) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int* make_pmt(const char *p) //得到回溯的数组 { unsigned int len = strlen(p); int *ret = static_cast(malloc(sizeof(int)*len)); if (NULL != ret) { ... 阅读全文
posted @ 2018-09-17 18:44 清浅...忆回 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 哈希函数的特性: 哈希函数的输入是无穷的 哈希函数的输出是有限的 哈希函数对于同一个数据,返回的结果是一样的,不是随机的 由于输入是无穷的,输出是有限的,则必然多个输入会对应同一个输出 哈希函数的返回具有离散型,对于很多个不同的输入,一定会出现相同的输出,相同的输出具有均匀分布的特点 (加入输入是( 阅读全文
posted @ 2018-09-13 19:56 清浅...忆回 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 创建一颗二叉树使用递归版实现前中后序遍历这颗二叉树和使用队列实现层序遍历 #include<iostream> #include<queue> #include<cstdio> using namespace std; struct TreeNode { char data; TreeNode *l 阅读全文
posted @ 2018-09-10 20:07 清浅...忆回 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<string> using namespace std; int main() { //string构造函数 string str1; cout << str1.c_str() << endl; //c_str 返回一个const char * 阅读全文
posted @ 2018-09-09 20:15 清浅...忆回 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 方法1:(错误) 方法2:(正确) 阅读全文
posted @ 2018-09-02 15:30 清浅...忆回 阅读(2657) 评论(0) 推荐(0) 编辑
摘要: 首先,我们需要知道在python中哪些是可变数据类型,哪些是不可变数据类型。可变数据类型:列表list和字典dict;不可变数据类型:整型int、浮点型float、字符串型string和元组tuple。 用一句话来概括上述过程就是:“python中的不可变数据类型,不允许变量的值发生变化,如果改变了 阅读全文
posted @ 2018-09-02 14:25 清浅...忆回 阅读(3216) 评论(0) 推荐(0) 编辑