当需要对struct入队时,可以使用如下格式方法入队
struct node {
int num;
int step;
};
queue<node>q;
q.push( (node){a,0} ); \\入队
node t=q.front() ; q.pop();\\调取队头
即可直接使用队头数据了
当需要对struct入队时,可以使用如下格式方法入队
struct node {
int num;
int step;
};
queue<node>q;
q.push( (node){a,0} ); \\入队
node t=q.front() ; q.pop();\\调取队头
即可直接使用队头数据了