上一页 1 ··· 76 77 78 79 80 81 82 83 84 ··· 92 下一页
摘要: #include<iostream> #include<cstdlib> using namespace std; #include<list> #include<string> /* 3.7.8 list容器的排序案例 案例描述:将Person自定义数据类型进行排序,Person中属性有姓名、年龄 阅读全文
posted @ 2021-05-11 17:30 yub4by 阅读(86) 评论(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 阅读(125) 评论(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 阅读(98) 评论(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 阅读(115) 评论(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 阅读(112) 评论(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 阅读(100) 评论(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 阅读(67) 评论(0) 推荐(0)
摘要: #include<iostream> //#include<stdlib.h> #include<cstdlib> // 效果同上 using namespace std; #include<string> #include<vector> #include<deque> #include<algo 阅读全文
posted @ 2021-05-10 20:55 yub4by 阅读(68) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<stdlib.h> 3 using namespace std; 4 #include<deque> 5 #include<algorithm> 6 7 8 /* 9 3.3.6 deque数据存取 10 at(int idx); // 阅读全文
posted @ 2021-04-27 22:43 yub4by 阅读(188) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<stdlib.h> 3 using namespace std; 4 #include<deque> 5 6 7 /* 8 3.3.5 deque插入和删除 9 两端插入操作: 10 push_back(elem); //在容器尾部添加 阅读全文
posted @ 2021-04-27 22:42 yub4by 阅读(119) 评论(0) 推荐(0)
上一页 1 ··· 76 77 78 79 80 81 82 83 84 ··· 92 下一页