队列删除头元素并用e返回,求大佬告诉我这两种写法有什么不同
Status DeQueue(SqQueue &Q, QElemType &e){
if (Q.front == Q.rear)
return Error;
e == Q.base[Q.front];
Q.front = (Q.front + 1) % Q.qsize;
return Ok;
}
Status DeQueue(SqQueue &Q, QElemType &e) {
e = Q.base[Q.front];
free(&Q.base[Q.front]);
if (e == Q.base[Q.front]) return Error;
Q.front = (Q.front + 1) % Q.qsize;
return Ok;
}