資源簡介
對一個有向無環(huán)圖(Directed Acyclic Graph簡稱DAG)G進行拓?fù)渑判颍菍中所有頂點排成一個線性序列,使得圖中任意一對頂點u和v,若邊(u,v)∈E(G),則u在線性序列中出現(xiàn)在v之前。通常,這樣的線性序列稱為滿足拓?fù)浯涡?Topological Order)的序列,簡稱拓?fù)湫蛄小:唵蔚恼f,由某個集合上的一個偏序得到該集合上的一個全序,這個操作稱之為拓?fù)渑判颉?
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?“tuopu.h“?
using?namespace?std;
#define?null?0
#define?max_course_num??100??//最大課程總數(shù)?
//主方法?
int?main(){
queue?q;
Queue.queue_init(&q);
AlGraph?CGraph;
CGraph=Graph.input();
system(“cls“);
Graph.output(CGraph);
cout< Judgement.judgingcricle(&CGraph&q);??//判斷是否有環(huán)?
if(!whethercricle){
system(“cls“);
Edit.layout(&CGraph&q);
}
system(“pause“);
return?0;
}?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????115??2018-05-13?10:48??courseplan.txt
?????文件????????535??2018-05-13?17:27??tuopu.cpp
?????文件???????7161??2018-05-13?17:27??tuopu.h
?????文件??????10122??2018-04-25?15:13??歷史代碼.txt
-----------?---------??----------?-----??----
????????????????17933????????????????????4
評論
共有 條評論