zhai 先进后出 可以想象成一个桶
用数组实现
#include<bits/stdc++.h>
using namespace std;
int skt[N],tt; //tt是zhai顶下标
插入
skt[++t] =x; // 插入元素
tt--; //弹出元素
判空
if(tt>0) //不空
else //空
队列 先进先出 想象成一个钢管
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6;
int q[N] , hh , tt=-1; //队列 队头 队尾
//在队尾插入元素
q[++tt] = x;
//弹出
hh++;