教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 高中教育 >

校园导航系统数据结构课程设计

来源:网络收集 时间:2026-01-19
导读: 课程设计报告书 课程名称 数据结构 设计题目 校园导航系统 专业班级 计算机11-4 班 学 号 1101050110 姓 名 刘冬冬 指导教师 彭延军 2013 年 12 月 目录 1.设计时间……………………………………………… 2 2.设计目的………………………………………………

课程设计报告书

课程名称 数据结构 设计题目 校园导航系统 专业班级 计算机11-4 班 学 号 1101050110 姓 名 刘冬冬 指导教师 彭延军

2013 年 12 月

目录

1.设计时间……………………………………………… 2 2.设计目的……………………………………………… 2 3.设计任务……………………………………………… 2 4.设计内容……………………………………………… 2

4.1需求分析………………………………………………… 2 4.2总体设计………………………………………………… 3 4.3详细设计………………………………………………… 4 4.4测试与分析………………………………………………12

4.4.1测试…………………………………………………………12 4.4.2分析…………………………………………………………13

4.5 附录………………………………………………………14

5 总结与展望…………………………………………… 20 6.参考文献……………………………………………… 21 7.成绩评定……………………………………………… 21

1 设计时间 2013 年 12 月 3 日 2 设计目的1.加深对《数据结构》这一课程所学内容的进一步理解与巩固 2.通过完成课程设计,逐渐培养自己的编程能力; 3.培养给出题目后,构建框架,用计算机解决的能力; 4.通过调试程序积累调试 C 程序设计的经验;

3 设计任务给出校园各主要建筑的名称信息及有线路联通的建筑之间的距离,利用校园导航系统计算出 给定的起点到终点之间的最近距离及线路。

4 设计内容4.1 需求分析1.程序所能达到的功能: (1) map——输出山东科技大学平面图。 (2) init()——按相应编号输入各个节点内容,对相应路径赋值的函数。 (3) floyd()-- --弗洛伊德求最短路径 (4) information()——输出简介的函数 (5) Path()——最短路径的输出函数 (6) shortestpath()——调用弗洛伊德和最短路径输出的函数 (7) main()——主函数 2.输入的形式和输入值的范围: 输入数字和字母: 字母:以 s 查询最短路径;以 i 查询信息;以 e 退出程序。 数字:从 1 到 9 输入。 3.输出的形式: 从 A 到 B 得最短路径为: A-到-C-到-D-到-B 最短距离为:xxx 米。2

4.测试数据包括在正确的输入及输出结果及含有错误的输入及输出结果: Input:s Output:Please enter the number two to query : 1 7 Output:The shortest path from Area C dormitory building to library is: Area C dormitory building--Area C restaurant--library; The shortest distance is:150meters. Input:i Output:Please enter the number of query site: 3 Output:@name: Area B dormitory building @introduction:Area B student rest area input:e output:Thank y

ou for you use

4.2 总体设计1.抽象数据类型定义 typedef struct { char name[100] ; int number; char introduce[100]; }Vertex; 2.主程序模块的整体流程 1、进入主函数,调用 init(),map()。 2、选择“s” ,调用 shortestpath 函数,并同时调用 floyd 和 way 函数。 3、选择“i”,调用 information 函数 4、选择“e”,退出。

3.各模块调用关系如下:

3

主函数

s

e

i

shortestpath

Exit

Information

4.3 详细设计1.有向网节点结构体类型定义: typedef struct { char name[100] ; int number; char introduce[100]; }Vertex; 2. 主程序和其它主要函数伪码算法 1)主程序 int main() { char i; printf(" Welcome to use the shandong university of science and technology of

navigation system\n\n\n\n"); init(); map(); char c; do { printf("Please enter the 's' to query the shortest path\n"); printf("Please enter the 'i' to query information\n");

4

printf("Please input 'e' to exit the program\n\n\n"); loop: scanf("%c",&c); if(c >= 'A' && c <= 'Z') { c += 32; } if(c == '\n') { goto loop; } if(c != '\n') { if(c == 's') { shortestpath(); continue; } else if(c == 'i') { Information(); continue; } else if(c == 'e') { printf("\n\n\n\t\t\t\tThank you for you use\n\n\n"); return 0; } else

5

{ printf("input error!!!\n"); continue; } } }while(1); return 0; } 2)赋值 init 函数 void init() { int i, j; vertex[1].number = 1; strcpy(vertex[1].name,"Area C dormitory building"); strcpy(vertex[1].introduce, "Area C student rest area"); vertex[2].number = 2; strcpy(vertex[2].name, "Area A dormitory building"); strcpy(vertex[2].introduce,"Area A student rest area"); vertex[3].number = 3; strcpy(vertex[3].name, "Area B dormitory building"); strcpy(vertex[3].introduce,"Area B student rest area"); vertex[4].number = 4; strcpy(vertex[4].name, "Area C restaurant"); strcpy(vertex[4].introduce,"Area C student dining area"); vertex[5].number = 5; strcpy(vertex[5].name,"Area A restaurant"); strcpy(vertex[5].introduce,"Area A student dining area"); vertex[6].number = 6; strcpy(vertex[6].name,"Area B restaurant");

6

strcpy(vertex[6].introduce,"Area B student dining area"); vertex[7].number = 7; strcpy(vertex[7].name,"library"); strcpy(vertex[7].introduce,"Student borrowing books area"); /*vertex[7].number = 8; strcpy(vertex[7].name,"Area A restaurant"); strcpy(vertex[7].introduce,"Area A student dining area");*/ vertex[8].number = 8; strcpy(vertex[8].name,"No. 1 teaching building"); strcpy(vertex[8].introduce,"Students in class area"); vertex[9].number = 9; strcpy(vertex[9].name,"No. 13 teaching building"); strcpy(vertex[9].introduce,"Information institute, college building"); for(i = 1; i < MAX_VERTEX_NUM; ++i) { for(j = 1; j < MAX_VERTEX_NUM; ++j) { dist[i][j] = INFINITY; } } for(i = 1; i < MAX_VERTEX_NUM; ++i) { dist[i][i] = 0; } dist[1][2] = dist[2][1] = 20; dist[2][3] = dist[3][2] = 40; dist[1][4] = dist[4][1] = 50; dist[2][5] = dist[5][2] = 30; dist[3][6] = dist[6][3] = 50

;

7

dist[4][5] = dist[5][4] = 70; dist[5][6] = dist[6][5] = 90; dist[4][7] = dist[7][4] = 100; dist[5][8] = dist[8][5] = 120; dist[6][9] = dist[9][6] = 80; dist[7][8] = dist[8][7] = 60; dist[8][9] = dist[9][8] =120; } 3)输出山东科技大学平面图的 map …… 此处隐藏:6692字,全部文档内容请下载后查看。喜欢就下载吧 ……

校园导航系统数据结构课程设计.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/1733428.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)