文章
70
粉丝
0
获赞
232
访问
8.6k
#include<stdio.h>
#include<malloc.h>
typedef struct Node{
int val;
struct Node * next;
int flag;
}Node;
void rearin(Node** pre,int num){ //尾插函数,给一个前驱结点,在该节点后插入值为num的新节点,并更新前驱节点以实现再次尾插
Node* p = (Node*)malloc(sizeof(Node));
p->val = num;
p->flag = 1;
p->next = NULL;
(*pre)->next = p;
*pre = p;
}
Node* creat(){
int N;
scanf("%d",&N);
if(N==0) return NULL;
else{
int num;
Node* q = (Node*)malloc(sizeof(Node));
scanf("%d",&num);
&n...
登录后发布评论
暂无评论,来抢沙发