数据结构课程设计模板内容(数据结构课程设计概要设计)
今天给各位分享数据结构课程设计模板内容的知识,其中也会对数据结构课程设计概要设计进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
数据结构课程设计
这个是程序:
#include "string.h"
#define NULL 0
unsigned int key;
unsigned int key2;
int *p;
struct node
{
char name[20],address[20];
char num[11];
struct node *next;
}
**phone;
**nam;
**address;
typedef struct node *pnode;
typedef struct node *mingzi;
void hash(char num[11])
{
int i = 3;
key=(int)num[2];
while(num[i]!=NULL)
{
key+=(int)num[i];
i++;
key=key%17;
}
void hash2(char name[8])
{
int i = 1;
key2=(int)name[0];
while(name[i]!=NULL)
{
key2+=(int)name[i];
i++;
}
Key2=key2%17;
}
struct node* input()
{
struct node *temp=(struct node*)malloc(sizeof(struct node));
temp = new node;
temp-next=NULL;
printf("qing shu ru xing ming(no more then 8 chars) :\n");
scanf("%s",temp-name);
printf"qing shu ru dian hua hao ma(no more then 11 numbers):\n");
scanf("%s",temp-num);
printf("qing shu ru di zhi(no more then 20 chars):\n");
scanf("%s",temp-address);
return temp;
}
int add()
{
struct node *newphone;
struct node *newname;
newphone=input();
printf("ni de ji lu shi");
if(find(newphone-num))
{
printf("hao ma yi jing cun zai bu nene zai tian jia.\n");
return 0;
}
if(find2(newphone-name))
{
printf("xing ming yi jing cun zai bu neng zai tian jia.\n");
return 0;
}
printf("%s_%s_%s\n",newphone-name,newphone-address,newphone-num);
newname=newphone;
newphone-next=NULL;
newname-next=NULL;
hash(newphone-num);
hash2(newname-name);
newphone-next = phone[key]-next;
phone[key]-next=newphone;
newname-next = nam[key2]-next;
nam[key2]-next=newname;
return 0;
}
int find(char num[11])
{
int isfind=0;
struct node *q;
hash(num);
node *q=phone[key]-next;
while(q!= NULL)
{
if(strcmp(num,q-num) ==0)
{
isfind=1;
break;
}
q=q-next;
}
if(isfind)
printf("%s_%s_%s\n",q-name,q-address,q-num);
return isfind;
}
int find2(char name[8])
{
int isfind=0;
hash2(name);
struct node *q=nam[key2]-next;
while(q!= NULL)
{
if(strcmp(name,q-name)==0)
{
isfind=1;
break;
}
q=q-next;
}
if(isfind)
printf("%s_%s_%s\n",q-name,q-address,q-num);
return isfind;
}
void create()
{
int i;
phone = (pnode*)malloc(13*sizeof(pnode));
for(i=0;i13;i++)
{
phone[i]=(struct node*)malloc(sizeof(struct node));
phone[i]-next=NULL;
}
}
void create2()
{
int i;
nam = (mingzi*)malloc(13*sizeof(mingzi));
for(i=0;i13;i++)
{
nam[i]=(struct node*)malloc(sizeof(struct node));
nam[i]-next=NULL;
}
}
void list()
{
int i;
struct node *p;
for(i=0;i13;i++)
{
p=phone[i]-next;
while(p)
{
printf("%s_%s_%s\n",p-name,p-address,p-num);
p=p-next;
}
}
}
void list2()
{
int i;
struct node *p;
for(i=0;i13;i++)
{
p=nam[i]-next;
while(p!=NULL)
{
printf("%s_%s_%s\n",p-name,p-address,p-num);
p=p-next;
}
}
}
void menu()
{
printf("0.tian jia ji lv.\n");
printf("2.cha zhao ji lu.\n");
printf("3.xing ming lie biao.\n");
printf("4.hao ma lie biao.\n");
printf("5.qing chu suo you ji lu.\n");
printf("6.tui chu xi tong.\n");
}
int main()
{
char num[11];
char name[8];
int sel;
create();
create2();
while(1)
{
menu();
scanf("%d",sel);
if(sel==3)
{
char b;
printf("Input 9 to search with number,8 to name.\n");
b=getch();
if(b=='9')
{
printf("Please input the number:\n");
scanf("%s",num);
if(!find(num))
printf("Record not exist.\n");
}
else if(b=='8')
{
printf("Please input the name:\n");
scanf("%s",name);
if(!find(name))
printf("Record not exist.\n");
}
else
{
printf("Wrong input!Please input again!\n");
continue;
}
}
else if(sel==2)
{
printf("All record with name:\n");
list2();
}
else if(sel==0)
{
printf("Please input the information:\n");
add();
}
else if(sel==4)
{
printf("All record with number:\n");
list();
}
else if(sel==5)
{
create();
create2();
printf("All records have been removed.\n");
}
else if(sel==6)
{printf("7");
break;
}
}
return 0;
}
数据结构课设总结
我正好在做课设,我把我的总结给你。
数据结构是计算机程序设计的重要理论技术基础,它不仅是计算机科学的核心课程,而且也已经成为其他理工专业的热门选修课。随着高级语言的发展,数据结构在计算机的研究和应用中已展现出强大的生命力,它兼顾了诸多高级语言的特点,是一种典型的结构化程序设计语言,它处理能力强,使用灵活方便,应用面广,具有良好的可移植性。
紧张的两周数据结构实训很快就过去了,通过这两周的实践学习,不仅使我们巩固了以前的知识并在此基础上还对数据结构的特点和算法有了更深的了解,使我们在这门课程的实际应用上也有了一个提高。
首先这两周的学习,使我们在巩固了原有的理论知识上,又培养了灵活运用和组合集成所学过知识及技能来分析、解决实际问题的能力,使我们体会到自身知识和能力在实际中的应用和发挥。其次,它激发了我们创新意识,开发创造的能力和培养沟通能力。另外,让我们进一步熟悉了数据结构的设计应用。每一处编码都是在反复的熟悉数据结构的结构特性,及其语法、函数和程序设计思想的过程,对我们数据结构的学习和提高很有益处,并且使我们明白了程序设计过程,如解决一些实际问题,从解决实际问题的角度,我们可以这样来看:第一要了解这个问题的基本要求,即输入、输出、完成从输入到输出的要求是什么;第二,从问题的要害入手,从前到后的解决问题的每个方面,即从输入开始入手,着重考虑如何从输入导出输出,在这个过程中,可确定所需的数据结构的基本类型——线性表、栈、队列、串、数组、广义表、树和二叉树以及图等,然后确定处理过程——算法,通过在编译环境中的编译与调试,可到最终的程序。最后,在这次的实训过程中,我们深刻的认识到了自己在学习方面的不足之处,我知道我还有太多的基本的思想没有真正的理解,当然我们不会灰心,我们会在以后的日子里努力弥补我们的不足。
在两周的实训中,我们也体会到了团队合作的重要性,从最初的查阅资料到最后的程序的成功运行,我们组有过山穷水尽的困惑;有过柳暗花明的惊喜;有过唇枪舌剑的辩论;有过相互鼓励的安慰。两个礼拜的时间我们经历了很多,也收获了很多。与其说这次的实训是体力与脑力的作业,不如说它是合作精神和毅力的考验。经过这次课程设计,我们不仅学到了很多知识和技能,更重要的是我们学会了如何运用所学知识去解决实际问题。
总之,两个礼拜的课程设计让我们受益匪浅。我们深深认识到,要学好一门学科,没有刻苦钻研的精神是不行的,只有在不断的尝试中,经历失败,从失败中总结经验,然后再不断的尝试,才能获得成功。
图书管理系统--数据结构课程设计
#include stdio.h
#include stdlib.h
#include conio.h
struct BOOK
{
int id,usr[10],total,store,days[10];
char name[30],author[20];
}books[100];
/*结构体,存放书籍及借书信息。*/
void page_title(char *menu_item)
{
printf(" 以下是图 书 管 理 系 统--请 按 要 求 操 作 \n\n- %s -\n\n",menu_item);
}
/*页头函数,可以通过参数menu_item,显示当前状态。*/
void return_confirm(void)
{
printf("\n任意键返回……\n");
getch();
}
/*返回前请求确认函数,方便返回前观察结果*/
int search_book(void)
{
int n,i;
printf("请输入图书序号:");
scanf("%d",i);
for(n=0;n100;n++)
{
if(books[n].id==i)
{
printf("书名:%s\n",books[n].name);
printf("作者:%s\n",books[n].author);
printf("存数:%d\n",books[n].store);
printf("总数:%d\n",books[n].total);
return n;
}
}
printf("\n输入有错或图书序号不存在.\n");
return -1;
}
/*上面是在数组中找到图书号匹配的记录,显示其信息并返
回数组下标,如果找不到相应记录则提示错误并返回-1。*/
void book_out(void)
{
int n,s,l,d;
page_title("借书");
if((n=search_book())!=-1books[n].store0)
{
printf("请输入借书证序号:");
scanf("%d",s);
printf("请输入可借天数:");
scanf("%d",d);
for(l=0;l10;l++)
{
if(books[n].usr[l]==0)
{
books[n].usr[l]=s;
books[n].days[l]=d;
break;
}
}
books[n].store--;
}
if(n!=-1books[n].store==0) printf("此书已经全部借出.\n");
return_confirm();
}
/*借书的函数,首先调用找书函数*/
void book_in(void)
{
int n,s,l;
page_title("还书");
if((n=search_book())!=-1books[n].storebooks[n].total)
{
printf("借阅者图书证列表:\n");
for(l=0;l10;l++)
if (books[n].usr[l]!=0)
printf("[%d] - %d天\n",books[n].usr[l],books[n].days[l]);
printf("请输入借书证序号:");
scanf("%d",s);
for(l=0;l10;l++)
{
if(books[n].usr[l]==s)
{
books[n].usr[l]=0;
books[n].days[l]=0;
break;
}
}
books[n].store++;
}
if(n!=-1books[n].store==books[n].total)
printf("全部入藏.\n");
return_confirm();
}
void book_add(void)
{
int n;
page_title("注册书");
for(n=0;n100;n++)
if(books[n].id==0) break;
printf("序号:");
scanf("%d",books[n].id);
printf("书名:");
scanf("%s",books[n].name);
printf("作者:");
scanf("%s",books[n].author);
printf("数量:");
scanf("%d",books[n].total);
books[n].store=books[n].total;
return_confirm();
}
void book_del(void)
{
int n;
page_title("注销书");
if((n=search_book())!=-1) books[n].id=0;
printf("该书已注销.\n");
return_confirm();
}
void main(void)
{
menu: page_title("操作选择单子");
printf("请按以上要求选择操作\n\n");
printf("1 借书\n2 还书\n\n");
printf("3 注册书\n4 注销书\n\n");
printf("\n0 退出\n");
switch(getch())
{
case '1' : book_out();break;
case '2' : book_in();break;
case '3' : book_add();break;
case '4' : book_del();break;
case '0' : exit(0);
}
goto menu;
}
数据结构课程设计-学生成绩管理系统的设计
好像没有数据结构的 你试试c++语言面向对象程序设计课程设计
这个网站能免费下几个,不能免费下的就要收费了
本站免费计算机课程设计论文下载
本人原创计算机类课程设计免费下载,销售计算机毕业论文
请把我的网站介绍给同学们.谢谢支持本站
ACCESS课程设计库存管理工资管理系统 sqlserver数据库课程设计 c++语言面向对象程序设计课程设计 vb课程设计学生成绩系统
asp留言板(没有论文) 计算机实训计算机组装与维护课程设计
简单的网页设计没有论文 office课程设计 操作系统课程设计
另有以上没有列出的计算机课程设计为收费材料30元一份 更多
数据结构课程设计模板内容的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于数据结构课程设计概要设计、数据结构课程设计模板内容的信息别忘了在本站进行查找喔。