Problem1428--邻接表存储图的广度优先遍历

1428: 邻接表存储图的广度优先遍历

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

试实现邻接表存储图的广度优先遍历。 函数接口定义: void BFS ( LGraph Graph, Vertex S, void (*Visit)(Vertex) ); 其中LGraph是邻接表存储的图,定义如下:

Input

图graph,结点S,结点访问标记

Output

图graph,结点S,结点访问标记

Sample Input Copy

2

Sample Output Copy

BFS from 2: 2 0 3 5 4 1 6

Source/Category