国家开放大学 / 数据结构(本)
题干
以下函数为链队列的入队操作,x为要入队的结点的数据域的值,front、rear分别是链队列的队头、队尾指针
struct node
{
ElemType data;
struct node *next;
};
struct node *front,*rear;
void InQueue(ElemType 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
参考答案:
佳题速递: