新建压缩(zipped)文件夹.zip
资源文件列表:

2310250680-赵子墨-大作业/2310250680-赵子墨-大作业.cpp 9.57KB
2310250680-赵子墨-大作业/2310250680-赵子墨-大作业.docx 35.63KB
2310250680-赵子墨-二级菜单/2310250680-赵子墨-二级菜单.cpp 4.73KB
2310250680-赵子墨-二级菜单/2310250680-赵子墨-二级菜单.doc 49KB
2310250680-赵子墨-链表/2310250680-赵子墨-链表.cpp 2.76KB
2310250680-赵子墨-链表/2310250680-赵子墨-链表.doc 62.5KB
资源介绍:
新建压缩(zipped)文件夹.zip
软件学院实验报告
姓名:赵子墨 学号:2310250680 专业:软件工程 年级:23 级
课程名称
程序设计基础课程设计
实验名称
案例一(链表相关操作)
实验内容
数据结构基础;链表构成;链表建立、清空、初始化、遍历;节点查找、
插入、删除等
实验类型
验证性、演示性
实验的重点、难点
数据结构概念初步理解、链表的建立过程、头指针(节点)的作用、和节
点有关的处理
技术原理及国内
外相关技术
结构化、模块化程序设计;面向对象程序设计思想;线性数据结构的链表
实现;C++程序设计技术
实验
的准
备阶
段
实验环境
明伦校区软件学院机房(i5 4590/4G/500G/Visual C++;AMD Athlon II
X3 450/4G/160G/Visual C++)
实验
的实
施阶
段
实验步骤及完成
任务情况
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Node
{
int data;
struct Node*next;
};
typedef struct Node Node;
typedef struct Node *Link;
char menu()
{
char select[100];
printf("*****************************");
printf("* 单链表 *");
printf("* *");
printf("* 1 插入结点 *");
printf("* 2 删除结点 *");
printf("* 3 查找结点 *");
printf("* 4 显示链表 *");
printf("* 5 退出系统 *");
printf("* *");
printf("*****************************");
printf("请选择:");
do

软件学院实验报告
{
fflush(stdin);
gets(select);
if(strlen(select)==1)
{
if(strcmp(select,"1")==0||strcmp(select,"2")==0||strcmp(sele
ct,"3")==0||strcmp(select,"4")==0||strcmp(select,"5")==0)
{
return select[0];
}
}
printf("输入有误!\n");
}while(1);
}
void create(Link head)
{
int i=0;
Link q=head;
while(i<5)
{
Link p=(Link)malloc(sizeof(Node));
p->data=(i+1)*10;
p->next=NULL;
q->next=p;
q=p;
i++;
}
}
void show(Link head)
{
Link p=head->next;
while(p!=NULL)
{
printf("%d\t",p->data);
p=p->next;
}
printf("\n");
}
int find(Link head,int num)
{
int i=1;
Link p=head->next;
while(p!=NULL)