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

  • 大小: 46KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-02
  • 語言: 其他
  • 標簽: Dijkstra??

資源簡介

利用vs2010實現的數據結構課程設計題目,能夠實現包含線路、站點信息的編輯和查詢,換乘查詢,支持文件數據的輸入輸出;能夠實現二次換乘和時間最短查詢。利用無向圖的Dijkstra 算法實現查詢;--cugxg2017

資源截圖

代碼片段和文件信息

//?地鐵路徑查詢.cpp?:?定義控制臺應用程序的入口點。
//
/*
作者:趙賽賽;
學校:中國地質大學(武漢);
班級:201161;
*/

#include?“stdafx.h“
#include?“iostream“
#include?“stdlib.h“
#include“fstream“
#include“string“
#include“assert.h“
#include???
#include???
using?namespace?std;
//存儲同學信息的結構體;
const?int?maxdist?=?1999999999;
typedef?struct?site
{
string?name;
int?key;
site?*link;
site(){name=““;link=NULL;};
site(string?sint?k){name=s;link=NULL;key=k;}
site(string?ssite*lint?k){name=s;link=l;key=k;}
};
class?sitegroup
{
public:
?site?*top;??????//棧頂指針
?????sitegroup()?:?top(NULL)?{} ???//構造函數;
?sitegroup(string?s)?:?top(NULL)?{} ???//構造函數;
?void?~linkedstack()?{?makeempty();?}???//析構函數;
?void?push(site?*x);
?int?count(){int?i;site*p=top;for(i=0;p!=NULL;i++)p=p->link;return?i;};
?bool?pop(); ???//退棧;
?site*?gettop()const; //取棧頂??;
?????bool?isempty()?const?{?return?top?==?NULL;?}
?????void?makeempty(); //清空棧的內容;
?bool?only(string?s)
?{
?site*t=gettop();
?for(int?i=0;i ?{
?if(t->name==s)return?false;
?else?t=t->link;
?}
?return?true;
?}
?void?getdata();
?int?getint(string?s)
?{
?site?*ss=gettop();
?for(int?i=0;i ?{
?if(ss->name==s)return?ss->key;
?ss=ss->link;
?}
?return?-1;
?}
?string?getname(int?s)
?{
?site?*ss=gettop();
?for(int?i=0;i ?{
?if(ss->key==s)return?ss->name;
?ss=ss->link;
?}
?return?NULL;
?}

}sites;
typedef?struct?edge{
string?prname;//站名;
string?lastname;
int?length;
int?time;
}edge;
struct?stacknode//棧節點;
{
edge?*data;
stacknode?*link;
stacknode(){link=NULL;};
stacknode(edge*?dstacknode?*next?=?NULL):?data(d)?link(next)?{?}
};
class?linkedstack{?//鏈式棧類定義???
public:
?stacknode?*top;
?string?name; ????????????//棧頂指針
?????linkedstack()?:?top(NULL)name(“未錄入“)?{} ???//構造函數;
?linkedstack(string?s)?:?top(NULL)name(s)?{} ???//構造函數;
?void?~linkedstack()?{?makeempty();?}???//析構函數;
?void?push(edge*?x); ????????????? ???//進棧;
?void?push(stacknode?*x);
?void?named(string?s){name=s;};
?int?count(){int?i;stacknode*p=top;for(i=0;p!=NULL;i++)p=p->link;return?i;};
?bool?pop(); ???//退棧;
?stacknode*?gettop()const; //取棧頂??;
?????bool?isempty()?const?{?return?top?==?NULL;?}
?????void?makeempty(); //清空棧的內容;
?string?showname(){return?name;}
?void?print();
};
struct?groupnode
{
linkedstack?*data;
groupnode*link;
groupnode(linkedstack*pgroupnode*l){data=p;link=l;}
groupnode(){data=NULL;link=NULL;}
};
class?groups
{
public:
groupnode*top;
groups(){top=NULL;}
bool?isempty(){return?top==NULL;}
void?push(linkedstack*x){top?=?new?groupnode(xtop);assert(top?!=?NULL);}
bool?pop()?{if?(isempty()?==?true)?return?false;groupnode?*p?=?top;top?=?top->link; delete?p;return?true;}
groupnode*?gettop(){if?(isempty()?==?true)?return?NULL;return?top;}
int?count(){int?i;groupnode*p=top;for(i=0;p!=NULL;i++)p=p->link;return?i;};

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????6189??2017-12-26?17:32??課設三\edge3.txt

?????文件??????24238??2017-12-27?21:39??課設三\地鐵路徑查詢.cpp

?????文件?????186880??2017-12-27?21:37??課設三\地鐵路徑查詢.exe

?????文件?????????48??2017-12-27?21:55??課設三\readme.txt

?????目錄??????????0??2017-12-27?21:53??課設三

-----------?---------??----------?-----??----

???????????????217355????????????????????5


評論

共有 條評論