資源簡介
【摘要】西南科技大學(xué)抓住西部大開發(fā)和綿陽科技城建設(shè)的歷史機(jī)遇,踐行“厚德、博學(xué)、篤行、創(chuàng)新”校訓(xùn),建設(shè)出一座美麗的校園。為此通過對《數(shù)據(jù)結(jié)構(gòu)》這一課程的應(yīng)用,用圖的模型對學(xué)校景點抽象。用鄰接矩陣存儲方法和狄克斯特拉算法及圖的遍歷實現(xiàn)對校園導(dǎo)游系統(tǒng)的模擬。此系統(tǒng)七個功能:瀏覽學(xué)校景點、查看單個景點信息、查看校園地圖、導(dǎo)游推薦、查兩景點最短路線、查兩景點所有景點、退出系統(tǒng)。 目 錄 一、問題描述及設(shè)計思路..............................................3 二、詳細(xì)設(shè)計過程........................................
代碼片段和文件信息
//構(gòu)造圖?及圖的相關(guān)操作,由狄克斯拉算法改成。
#include
#include?“Sight.h“
#define?MAXV?50?
#define?INF?32767?
typedef?int?InfoType;?
//鄰接矩陣存儲方法?
typedef?struct?
{?
int?edges[MAXV][MAXV];?
int?ne;??
}?MGraph;?
MGraph?g;
int?path[10];
int?pathF[10]={0};
int?nowVal;
int?BPsize=0;
int?EofV(int?start)
{
int?con=0;
for(int?j=0;j if(g.edges[start][j]!=0&&g.edges[start][j] con++;
return?con;
}
int?Nest(int?startint?i)
{
int?con=0;
for(int?j=0;j {
if(g.edges[start][j]!=0&&g.edges[start][j] con++;
if(con==i)
return?j;
}
return?0;
}
void?Print()
{
int?TVal=0;
for(int?j=0;j {
TVal=TVal+g.edges[path[j]][path[j+1]];
cout<“;
}
cout< cout<<“總?長:“< }
void?FindAllWay(int?startint?endint?n)
{
int?i;
if(start==end)
{
path[n]=start;
BPsize=n+1;
Print();
return?;
}
int?num=EofV(start);
path[n]=start;
for(i=1;i
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2418??2009-01-10?00:57??導(dǎo)航\2.cpp
?????文件???????3341??2009-01-08?14:35??導(dǎo)航\2.dsp
?????文件????????510??2009-01-08?15:03??導(dǎo)航\2.dsw
?????文件??????41984??2009-01-10?00:58??導(dǎo)航\2.ncb
?????文件??????48640??2009-01-10?00:58??導(dǎo)航\2.opt
?????文件????????723??2009-01-10?00:57??導(dǎo)航\2.plg
?????文件?????282294??2009-01-11?00:52??導(dǎo)航\4錯識輸入.bmp
?????文件?????446302??2009-01-11?00:53??導(dǎo)航\5錯.bmp
?????文件?????229441??2009-01-10?00:57??導(dǎo)航\Debug\2.exe
?????文件?????427308??2009-01-10?00:57??導(dǎo)航\Debug\2.ilk
?????文件??????37930??2009-01-10?00:57??導(dǎo)航\Debug\2.obj
?????文件?????336844??2009-01-08?14:35??導(dǎo)航\Debug\2.pch
?????文件?????607232??2009-01-10?00:57??導(dǎo)航\Debug\2.pdb
?????文件?????229444??2009-01-11?01:06??導(dǎo)航\Debug\main.exe
?????文件?????485576??2009-01-11?01:06??導(dǎo)航\Debug\main.ilk
?????文件??????51489??2009-01-11?01:06??導(dǎo)航\Debug\main.obj
?????文件?????338392??2009-01-11?00:56??導(dǎo)航\Debug\main.pch
?????文件?????623616??2009-01-11?01:06??導(dǎo)航\Debug\main.pdb
?????文件??????58368??2009-01-11?10:17??導(dǎo)航\Debug\vc60.idb
?????文件??????69632??2009-01-11?01:06??導(dǎo)航\Debug\vc60.pdb
?????文件?????326742??2009-01-10?21:20??導(dǎo)航\Fun?景點信息查詢.bmp
?????文件?????324378??2009-01-11?00:37??導(dǎo)航\Fun?景點路徑查詢.bmp
?????文件???????4397??2009-01-11?00:35??導(dǎo)航\G.h
?????文件???????1065??2009-01-11?01:06??導(dǎo)航\main.cpp
?????文件???????3377??2009-01-07?21:55??導(dǎo)航\main.dsp
?????文件????????516??2009-01-07?23:33??導(dǎo)航\main.dsw
?????文件??????50176??2009-01-11?10:17??導(dǎo)航\main.ncb
?????文件??????48640??2009-01-11?10:17??導(dǎo)航\main.opt
?????文件???????1241??2009-01-11?01:06??導(dǎo)航\main.plg
?????文件???????4648??2009-01-11?00:35??導(dǎo)航\Sight.h
............此處省略14個文件信息
評論
共有 條評論