随笔分类 -  STL---queue

摘要:题目链接:https://www.acwing.com/problem/content/831/ 数组模拟队列 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N=1e5+10; 4 int a[N]; 5 int h=0, 阅读全文
posted @ 2022-01-12 09:24 wydxry 阅读(57) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://www.nowcoder.com/practice/54275ddae22f475981afa2244dd448c6?tpId=13&tqId=11158&tPage=1&rp=1&ru=%2Fta%2Fcoding-interviews&qru=%2Fta%2Fcodin 阅读全文
posted @ 2020-04-12 16:21 wydxry 阅读(354) 评论(0) 推荐(0) 编辑
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 typedef int ElemType; 4 typedef struct LinkNode{ 5 ElemType data; 6 struct LinkNode *next; 7 }LinkNode; 8 阅读全文
posted @ 2020-03-21 15:09 wydxry 阅读(366) 评论(0) 推荐(0) 编辑
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #define MaxSize 5 4 typedef int ElemType; 5 typedef struct{ 6 //数组,存储MaxSize-1个元素 7 ElemType data[MaxSize 阅读全文
posted @ 2020-03-21 15:03 wydxry 阅读(803) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://www.nowcoder.com/practice/ccc3d1e78014486fb7eed3c50e05c99d?tpId=40&tqId=21351&tPage=1&rp=1&ru=/ta/kaoyan&qru=/ta/kaoyan/question-ranking 阅读全文
posted @ 2019-04-12 13:45 wydxry 阅读(263) 评论(0) 推荐(0) 编辑
摘要:问题描述 队列操作题。根据输入的操作命令,操作队列(1)入队、(2)出队并输出、(3)计算队中元素个数并输出。 输入格式 第一行一个数字N。 下面N行,每行第一个数字为操作命令(1)入队、(2)出队并输出、(3)计算队中元素个数并输出。 输出格式 若干行每行显示一个2或3命令的输出结果。注意:2.出 阅读全文
posted @ 2019-02-27 17:53 wydxry 阅读(340) 评论(0) 推荐(0) 编辑
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <queue> 4 using namespace std; 5 int main() 6 { 7 queue<int> q; 8 q.push(1);//1 9 q.push(2);//1,2 阅读全文
posted @ 2018-12-30 18:26 wydxry 阅读(275) 评论(0) 推荐(0) 编辑

Live2D