91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 520KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-14
  • 語言: C/C++
  • 標(biāo)簽: VC??Dijkstra??最短路徑??

資源簡(jiǎn)介

用VC6.0開發(fā)的Dijkstra算法的三個(gè)應(yīng)用實(shí)例,方法1中包含了圖的生成和鄰接表存儲(chǔ),方法2和三需要用戶手動(dòng)輸入,用鄰接矩陣存儲(chǔ) Dijkstra's algorithm with VC6.0 developed three application examples, the method includes a graph adjacency table generation and storage, two and three methods require the user to manually enter, with adjacency matrix storage

資源截圖

代碼片段和文件信息

//Dijkstra算法的完整實(shí)現(xiàn)版本,算法的源代碼
/*?Dijkstra.c
?
????Copyright?(c)?2002?2006?by?ctu_85
????All?Rights?Reserved.
*/
#include?“stdio.h“
#include?“malloc.h“
#define?maxium?32767
#define?maxver?9?/*defines?the?max?number?of?vertexs?which?the?programm?can?handle*/
#define?OK?1
struct?Point
{
???????char?vertex[3];
???????struct?link?*work;
???????struct?Point?*next;
};
struct?link
{
???????char?vertex[3];
???????int?value;
???????struct?link?*next;
};
struct?Table?/*the?workbannch?of?the?algorithm*/
{
???????int?cost;
???????int?Known;
???????char?vertex[3];
???????char?path[3];
???????struct?Table?*next;
};
int?Dijkstra(struct?Point?*struct?Table?*);
int?PrintTable(intstruct?Table?*);
int?PrintPath(intstruct?Table?*struct?Table?*);
struct?Table?*?CreateTable(intint);
struct?Point?*?FindSmallest(struct?Table?*struct?Point?*);/*Find?the?vertex?which?has?the?smallest?value?reside?in?the?table*/
int?main()
{
???????int?ijnumtempval;
???????char?c;
???????struct?Point?*poinpre*poinhead*poin;
???????struct?link?*linpre*linhead*lin;
???????struct?Table?*tabhead;
???????poinpre=poinhead=poin=(struct?Point?*)malloc(sizeof(struct?Point));
???????poin->next=NULL;
???????poin->work=NULL;
???????restart:
???????printf(“Notice:if?you?wanna?to?input?a?vertexyou?must?use?the?format?of?number!\n“);
???????printf(“Please?input?the?number?of?points:\n“);
???????scanf(“%d“&num);
???????if(num>maxver||num<1||num%1!=0)
???????{
??????????????printf(“\nNumber?of?points?exception!“);
??????????????goto?restart;
???????}
???????for(i=0;i???????{
??????????????printf(“Please?input?the?points?next?to?point?%dend?with?0:\n“i+1);
??????????????poin=(struct?Point?*)malloc(sizeof(struct?Point));
??????????????poinpre->next=poin;
??????????????poin->vertex[0]=‘v‘;
??????????????poin->vertex[1]=‘0‘+i+1;
??????????????poin->vertex[2]=‘\0‘;
??????????????linpre=lin=poin->work;
??????????????linpre->next=NULL;
??????????????for(j=0;j??????????????{
??????????????printf(“The?number?of?the?%d?th?vertex?linked?to?vertex?%d:“j+1i+1);
??????????????scanf(“%d“&temp);
??????????????if(temp==0)
?????????????????????{
?????????????????????lin->next=NULL;
?????????????????????break;
?????????????????????}
??????????????else
?????????????????????{
?????????????????????lin=(struct?link?*)malloc(sizeof(struct?link));
?????????????????????linpre->next=lin;
?????????????????????lin->vertex[0]=‘v‘;
?????????????????????lin->vertex[1]=‘0‘+temp;
?????????????????????lin->vertex[2]=‘\0‘;
?????????????????????printf(“Please?input?the?value?betwixt?%d?th?point?towards?%d?th?point:“i+1temp);
?????????????????????scanf(“%d“&val);
?????????????????????lin->value=val;
?????????????????????linpre=linpre->next;
?????????????????????lin->next=NULL;
?????????????????????}
??????????????}
??????????????poinpre=poinpre->next;
??????????????poin->next=NULL;
???????}
???????printf(“Please

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-07-06?18:41??Dijkstra?example\
?????目錄???????????0??2013-07-06?18:38??Dijkstra?example\Dijkstra1\
?????文件????????7503??2013-07-06?16:40??Dijkstra?example\Dijkstra1\aa.cpp
?????文件????????4280??2013-07-06?18:30??Dijkstra?example\Dijkstra1\addasf.dsp
?????文件?????????535??2013-07-06?16:39??Dijkstra?example\Dijkstra1\addasf.dsw
?????文件???????33792??2013-07-06?18:30??Dijkstra?example\Dijkstra1\addasf.ncb
?????文件???????48640??2013-07-06?18:30??Dijkstra?example\Dijkstra1\addasf.opt
?????文件????????1478??2013-07-06?16:40??Dijkstra?example\Dijkstra1\addasf.plg
?????目錄???????????0??2013-07-06?18:38??Dijkstra?example\Dijkstra1\Debug\
?????文件????????9550??2013-07-06?16:40??Dijkstra?example\Dijkstra1\Debug\aa.obj
?????文件??????167979??2013-07-06?16:40??Dijkstra?example\Dijkstra1\Debug\addasf.exe
?????文件??????172548??2013-07-06?16:40??Dijkstra?example\Dijkstra1\Debug\addasf.ilk
?????文件??????214100??2013-07-06?16:40??Dijkstra?example\Dijkstra1\Debug\addasf.pch
?????文件??????336896??2013-07-06?16:40??Dijkstra?example\Dijkstra1\Debug\addasf.pdb
?????文件???????33792??2013-07-06?16:42??Dijkstra?example\Dijkstra1\Debug\vc60.idb
?????文件???????45056??2013-07-06?16:40??Dijkstra?example\Dijkstra1\Debug\vc60.pdb
?????目錄???????????0??2013-07-06?18:40??Dijkstra?example\Dijkstra2\
?????目錄???????????0??2013-07-06?18:40??Dijkstra?example\Dijkstra2\源代碼\
?????目錄???????????0??2013-07-06?18:40??Dijkstra?example\Dijkstra2\源代碼\Debug\
?????文件???????66560??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.bsc
?????文件??????192591??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.exe
?????文件??????254264??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.ilk
?????文件???????10996??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.obj
?????文件??????242232??2013-07-06?18:12??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.pch
?????文件??????517120??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.pdb
?????文件???????????0??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\ShortPath.sbr
?????文件???????41984??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\vc60.idb
?????文件???????61440??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\Debug\vc60.pdb
?????文件????????2689??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\ShortPath.cpp
?????文件????????3441??2013-07-06?18:37??Dijkstra?example\Dijkstra2\源代碼\ShortPath.dsp
?????文件?????????541??2005-06-09?17:16??Dijkstra?example\Dijkstra2\源代碼\ShortPath.dsw
............此處省略22個(gè)文件信息

評(píng)論

共有 條評(píng)論