栈
//栈:先进后出
int stk[N], tt;
//插入
stk[ ++ tt ] = x;
//弹出
tt --;
//判断栈是否为空
if(tt > 0) not empty
else empty
//栈顶
stk[tt];
队列
//队列:先进先出
int q[N],hh,tt = -1;
//插入
q[ ++ tt] = x;
//弹出
hh ++ ;
//判断是否为空
if(hh <= tt) not empty
else empty
//取出队头元素
q[hh];
//取出队尾元素
q[tt];