摘要:
#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)

浙公网安备 33010602011771号