STL 小白学习(6) queue
//queue 一端插入 另一端删除
//不能遍历(不提供迭代器) 不支持随机访问
#include <queue>
#include <iostream>
using namespace std; void test01() {
queue<int> q1;
q1.push();//尾部插入
q1.push();
q1.push();
q1.pop();//删除队头
cout << q1.back();//返回队尾元素
cout << q1.front();//返回队头元素
cout << q1.size();
if (q1.empty()) {} } int main() { }
STL 小白学习(6) queue的更多相关文章
- STL初步学习(queue,deque)
4.queue queue就是队列,平时用得非常多.栈的操作是只能是先进先出,与栈不同,是先进后出,与之后的deque也有区别.个人感觉手写队列有点麻烦,有什么head和tail什么的,所以说 STL ...
- STL 小白学习(1) 初步认识
#include <iostream> using namespace std; #include <vector> //动态数组 #include <algorithm ...
- STL 小白学习(10) map
map的构造函数 map<int, string> mapS; 数据的插入:用insert函数插入pair数据,下面举例说明 mapStudent.insert(pair<, &qu ...
- STL 小白学习(9) 对组
void test01() { //构造方法 pair<, ); cout << p1.first << p1.second << endl; pair< ...
- STL 小白学习(8) set 二叉树
#include <iostream> using namespace std; #include <set> void printSet(set<int> s) ...
- STL 小白学习(7) list
#include <iostream> using namespace std; #include <list> void printList(list<int>& ...
- STL 小白学习(5) stack栈
#include <iostream> #include <stack> //stack 不遍历 不支持随机访问 必须pop出去 才能进行访问 using namespace ...
- STL 小白学习(4) deque
#include <iostream> #include <deque> //deque容器 双口 using namespace std; void printDeque(d ...
- STL 小白学习(3) vector
#include <iostream> using namespace std; #include <vector> void printVector(vector<in ...
随机推荐
- java框架之SpringBoot(15)-安全及整合SpringSecurity
SpringSecurity介绍 Spring Security 是针对 Spring 项目的安全框架,也是 Spring Boot 底层安全模块默认的技术选型.它可以实现强大的 Web 安全控制.对 ...
- js $的扩展写法
(function ($, w) { $.extend({ getRenderList: function (keyword, pageIndex, pageSize, renderEle, re ...
- tp5 model controlle sql
model::::use think\Db 引用db库类 用于数据库之类use think\Model 引用模板use think\Cookie 引用传值 $rs=Db::name(‘表名’)-> ...
- This Debug perspective is designed to support application debugging.it incorporates views for displaying the debug stack,variables and breakpoint mamagement
使用IDE(Eclipse Version:Neon.2 Release (4.6.2)),出现以下提示信息: This kind of launch is configured to openthe ...
- pascal中的xor,shr,shl,Int(),ArcTan(),copy,delete,pos和leftstr,RightStr等详解
数学函数:Inc(i)使I:=I+1;Inc(I,b)使I:=I+b;Abs(x)求x的绝对值例:abs(-3)=3Chr(x)求编号x对应的字符. 例:Chr(65)=’A’chr(97)=’a’c ...
- oracle 死锁
oracle 死锁 --查用户名,查客户端机器 SELECT distinct s.username,s.MACHINE, s.sid||','||s.serial# FROM gv$session ...
- MongoSpark 28799错误
Exception : . The full response is { , "codeName" : "Location28799" } at com.mon ...
- 外网访问内网Elasticsearch WEB
外网访问内网Elasticsearch WEB 本地安装了Elasticsearch,只能在局域网内访问其WEB,怎样从外网也能访问本地Elasticsearch? 本文将介绍具体的实现步骤. 1. ...
- Guitar Pro 添加装饰音
在使用Guitar Pro进行乐谱弹唱或者自己作曲时,我们经常会碰到在乐谱上出现一些装饰音,那么大家肯定会有问题了,装饰音是什么?如何使用Guitar Pro来添加装饰音呢? 装饰音是用来装饰旋律的临 ...
- vue 文件目录结构详解
vue 文件目录结构详解 本篇文章主要介绍了vue 文件目录结构详解,小编觉得挺不错的,现在分享给大家,也给大家做个参考.一起跟随小编过来看看吧 项目简介 基于 vue.js 的前端开发环境,用于前后 ...