Graphs_dart/tex/dart/pseudoBFS.txt

10 lines
169 B
Plaintext
Raw Normal View History

2021-11-23 15:53:01 +03:00
BFS(G, s):
queue Q
s <- visited
Q.add(s)
while (Q.not_empty):
u = Q.pop
for a in u.connections:
if a is unvisited:
Q.add(a)
a <- visited