队列的特性是先进先出
int q[N], hh = 0, tt = -1;//在队尾插入元素,在队头弹出元素 // 队头弹出元素 hh ++; //判断是否为空 if(hh <= tt)no empty else empty //插入操作 q[++ tt] = x;
int q[N], hh = 0, tt = -1;//在队尾插入元素,在队头弹出元素 // 队头弹出元素 hh ++; //判断是否为空 if(hh <= tt)no empty else empty //插入操作 q[++ tt] = x;