📄 graphtrace.cpp
字号:
#include <iostream>
#include <string>
using namespace std;
#include "Adjmulist.h"
void visit(VertexType v)
{
cout << v;
}
int main()
{
AMLGraph g;
VertexType v1,v2;
CreateGraph(g); /* 利用数据文件创建无向图,在bo7-1.c中 */
Display(g); /* 输出无向图,在bo7-1.c中 */
cout << "深度优先搜索的结果:" << endl;
DFSTraverse(g,visit); /* 在bo7-1.c中 */
cout << "广度优先搜索的结果:" << endl;
BFSTraverse(g,visit); /* 在bo7-1.c中 */
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -