?? dfstree.cpp
字號:
// find a depth-first spanning tree
#include<iostream.h>
#include "lg2.h"
#include "edge.h"
void main(void)
{
LinkedGraph G(0);
Edge DT[100];
// try three graphs
for (int j = 1; j <= 3; j++) {
G.Input();
cout << "The input graph is" << endl;
G.Output();
if (G.DSpanningTree(j,DT)) {
cout << "The depth-first spanning tree edges are" << endl;
for (int i = 0; i <= G.Vertices()-2; i++)
cout << DT[i] << ' ' ;
cout << endl;}
else cout << "The graph has no spanning tree" << endl;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -