【问题】 以下函数为链栈的进栈操作,x是要进栈的结点的数据域,top为栈顶指针struct node{ ElemType data;struct node *next;};struct node *top ;void Push(ElemType x) { struct node *p; p=(struct node*)malloc __(1)__; p->data=x; __(2)__; __(3)
以下函数为链栈的进栈操作,x是要进栈的结点的数据域,top为栈顶指针struct node{ ElemType data;struct node *next;};struct node *top ;void Push(ElemType x) { struct node *p; p=(struct node*)malloc __(1)__; p->data=x; __(2)__; __(3)__; }
正确答案:选项1 sizeof (struct node)选项2 p->next=top选项3 top=p
题目解析:本题出自长春广播电视大学,数据结构国家开放大学,由丰阳塔题库搜集整理。