吉林大学数据结构设计的真题

# include & ltstdio.h & gt

# include & ltmalloc.h & gt

结构节点{

int键;

结构节点* next

};

void creat_link(结构节点*);

主()

{

结构节点* head = NULL

creat_link(头);

}

void creat_link(结构节点*头节点)

{

结构节点*p,*q,* Temp

int数;

printf("请输入数据:[-1为End]\ n ");

scanf("%d ",& amp号);

而(号!=-1){

q=(结构节点*)malloc(sizeof(结构节点));

q->;key =数字;

if(head_node==NULL ){

head _ node = q;

p = q;

}

否则{

p->;next = q;

p = q;

}

scanf("%d ",& amp号);

}

p->;next = NULL

Temp =头节点;

while(Temp!=NULL){

printf("%d\n ",Temp-& gt;关键);

Temp = Temp-& gt;接下来;

}

}