数据结构 结点

来源:百度知道 编辑:UC知道 时间:2024/06/06 05:20:21
我要插入一个新结点??????
请大家帮帮我,写仔细点,在帮帮写写步??????

int insertPost_(LinkList llist,Pnode p ,int x)
{
/*在llist带头的节点的单链表中,p所指接点后面插入元素x*/
Pnode q=(Pnode)malloc(sizeof(struct Node));
if(q==null){printf("out of space");return(0);
}
else{q->info=x;q->link=p->link;p->link=q;return(1);}
}