The basic algorithm for BFS:
BFS的基本算法:
set start vertex to visited
load it into queue
while queue not empty
for each edge incident to vertex
if its not visited
load into queue
mark vertex
set The basic algorithm for BFS:
BFS的基本算法:
set start vertex to visited
load it into queue
while queue not empty
for each edge incident to vertex
if its not visited
load into queue
mark vertex
set