A-A+

以下函数为链队列的人队操作 x为要入队的结点的数据域的值 front rear分别是链队列的

2022-08-12 18:11:38 问答库 阅读 197 次

问题详情

以下函数为链队列的人队操作,x为要入队的结点的数据域的值,front、rear分别是链队列的队头、队尾指针
struct node
{ElemType data;
struct node * next;
};
struct node *front,*rear;
void InQueueCElemType x)
{
struct node * p;
p= (struct node*)________________;
p一>data=x;
p一>next=NULL;
______________________;
rear=_____________;
}

参考答案

参考答案(1) malloc( sizeof (struct node))? ? (2)rear一>next=p? ? (3)p

考点:队列,结点