哪里有数据结构中关于链表的源程序

来源:百度知道 编辑:UC知道 时间:2024/07/03 03:10:41
单链表,双链表,循环链表都要,需要基本的操作如建立,删除,查找,插入等,做好还有可执行程序

6月7日 16:54 #include
#include
#define OK 1
#define ERROR 0
typedef struct airline{
char air_num[8];
char plane_num[8];
char end_place[20];
int total;
int left;
struct airline *next;
}airline;
typedef struct customer{
char name[8];
char air_num[8];
int seat_num;
struct customer *next;
}customer;
airline *start_air()
{
airline *a;
a=(airline*)malloc(sizeof(airline));
if(a==NULL)
a->next=NULL;
return a;
}
customer *start_cus()
{
customer *c;
c=(customer*)malloc(sizeof(customer));
if(c==NULL)
c->next=NULL;
return c;
}
airline *modefy_airline(airline *l,char *air_num)
{
airline *p;
p=l->next;
for(;p!=NULL;p=p->next)
{
if(strcmp(air_num,p->air_num)==0)
{
p->left++;
return l;
}
printf("NO the airline!");
return 0;
}
}
int