上一页 1 ··· 75 76 77 78 79 80 81 82 83 ··· 91 下一页
摘要: 1 #include<iostream> 2 #include<cstdlib> 3 using namespace std; 4 #include<set> 5 #include<string> 6 7 8 /* 9 3.8.6 set和multiset区别 10 11 set不可以插入重复数据, 阅读全文
posted @ 2021-05-12 11:16 yub4by 阅读(112) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<cstdlib> 3 using namespace std; 4 #include<set> 5 6 7 /* 8 3.8.3 set容器大小和交换 9 10 size(); //返回容器中元素的数目 11 empty(); //判断 阅读全文
posted @ 2021-05-12 11:14 yub4by 阅读(124) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include<set> /* 3.8 set/multiset容器 3.8.1 set基本概念 简介:所有元素都会在插入时自动被排序 本质:set/multiset属于关联式容器, 阅读全文
posted @ 2021-05-12 11:12 yub4by 阅读(112) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include<list> #include<string> /* 3.7.8 list容器的排序案例 案例描述:将Person自定义数据类型进行排序,Person中属性有姓名、年龄 阅读全文
posted @ 2021-05-11 17:30 yub4by 阅读(71) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include <list> #include<algorithm> /* 3.7.6 list容器数据存取 front(); //返回第一个元素。 back(); //返回最后一个 阅读全文
posted @ 2021-05-11 17:29 yub4by 阅读(105) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include <list> /* 3.7.5 list 插入和删除 push_back(elem);//在容器尾部加入一个元素 pop_back();//删除容器中最后一个元素 p 阅读全文
posted @ 2021-05-11 17:28 yub4by 阅读(84) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include <list> /* 3.7.3 list赋值和交换 给list容器进行赋值,以及交换list容器 assign(beg, end); //将[beg, end)区间中 阅读全文
posted @ 2021-05-11 14:43 yub4by 阅读(111) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include<list> /* 3.7 list容器 3.7.1 list容器基本概念 功能:将数据进行链式存储 链表(list)是一种物理存储单元上非连续的存储结构,数据元素的逻 阅读全文
posted @ 2021-05-11 14:42 yub4by 阅读(96) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include<queue> /* 3.6 queue容器 队列queue是一种先进先出(First In First Out,FIFO)的数据结构,它有两个出口 队列容器允许从一端 阅读全文
posted @ 2021-05-11 09:54 yub4by 阅读(97) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdlib> using namespace std; #include<stack> /* 3.5 stack容器 栈stack是一种先进后出(First In Last Out,FILO)的数据结构,它只有一个出口 栈中只有顶端的元素才 阅读全文
posted @ 2021-05-11 09:52 yub4by 阅读(53) 评论(0) 推荐(0)
上一页 1 ··· 75 76 77 78 79 80 81 82 83 ··· 91 下一页