?? 拓撲排序.cpp
字號:
//拓撲排序測試程序
#include <iostream>
#include "ad.h"
using namespace std;
void main(void)
{
AdjacencyDigraph G(5);
int V[6];
int n = 5;
// input digraph
cout << "enter number of edges of 5 vertex digraph" << endl;
int e, u, v;
cin >> e;
for (int i = 1; i <= e; i++) {
cout << "enter edge " << i << endl;
cin >> u >> v;
G.Add(u,v);}
cout << "The network's adjacency matrix is" << endl;
G.Output();
cout << "Return status = " << G.Topological(V) << endl;
cout << "The topological order is" << endl;
for (i = 0; i <= n-1; i++)
cout << V[i] << endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -