1 / 31
文档名称:

中南民族大学数据结构实验.doc

格式:doc   大小:491KB   页数:31页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

中南民族大学数据结构实验.doc

上传人:慢慢老师 2021/12/5 文件大小:491 KB

下载得到文件列表

中南民族大学数据结构实验.doc

相关文档

文档介绍

文档介绍:30
院 系: 计算机科学学院
专 业:计算机科学与技术
年 级: 2011级
课程名称: 数据结构
学 号: 11061100
姓 名: 田芝华
指导教师: 姜卓睿
2013年 5 月 26日
1
年级
2011
班号
 4班
 学号
 11061100
专业
计算机科学与技术
 姓名
 田芝华
实验名称
  线性表运算
实验
类型
设计型
综合型
创新型








实验目的
掌握线性表的结构特点。
掌握线性表的基本操作:初始化,插入,删除,查找,判空,求线性表长度等运算在顺序存储结构和链式存储结构上的实现。
通过本章实验帮助学生加深对C语言的使用(特别是函数的参数调用、指针类型的应用)。
实验要求
所写源代码编程风格良好,有详细注释。
程序运行界面良好,使用菜单实现每个基本操作。
实验报告书写规范。
2










 
 #include <>
#define NULL 0
struct student
{
int num;
int age;
int sex;
struct student *next;
};
/*struct student *creat()
{
struct student *head,*p,*q;
long x;
q=head=(struct student *)malloc
(sizeof(struct student));
head->next=NULL;
printf("\nplease input datds to the list:");
scanf("%ld",&x);
while(x!=0)
{
p=(struct student *)malloc
(sizeof(struct student));
p->num=x;
p->next=NULL;
q->next=p;
q=p;
scanf("%ld",&x);
}
return(head);
} */
void show(void)
{ printf("1...............insert\n");
printf("2...............print\n");
printf("3...............delete\n");
printf("4...............save\n");
printf("5...............filein\n");
printf("6...............exit\n");
printf("input 1..6:");
}
void insert(struct student *head)
{
struct student *p,*q,*t;
p=(struct student*)malloc(sizeof(struct student));

scanf("%d",&p->num);
printf("\nplease input the student's age:");
scanf("%ld",&p->age);
printf("\nplease input the student's is man,0 is woman:");
scanf("%ld",&p->sex);
q=head;
 
 
 
 
 
 
 
 
 
 
 
3










printf("\nplease input the student's numble yo