这是数据结构中的链式队列的入队代码(是从网上拷贝下来的),我不明白为什么s的next域永远都等于NULL,这样不就不能跟其他结点连起来了吗,
int InsertQueue(LinkQueue &Q, QElemType e)
{
QueuePtr s = (QueuePtr)malloc(sizeof(QNode));
if (!s)
{
cout << "插入失败!" << endl;
return ERROR;
}
s->data = e;
s->next = NULL;
Q.rear->next = s;
Q.rear = s;
return OK;
}