12 Starting Node Apply Bfs Algorithm Q37029887

1.2 Starting from node A apply BFS algorithm. 같 :@1.2 Starting from node A apply BFS algorithm. 같 :@ Show transcribed image text 1.2 Starting from node A apply BFS algorithm. 같 :@


Answer


BFS pseudo code:-

BFS(v)

{

Visited[v] = 1

add(v,Q)// Q is queue

while (Q is not empty)

{

x = delete(Q)

printf(x)

for all w adjacent to x

{

if(w is not visited)

{

visited[w] = 1

add(w,Q)

}

}

}

Applying above algorithm we get:-

Delete B y Delete D y Delete C Delete E Delete-G lDelete H Delete. F Ul, Here,while Oop stop,s

Delete B y Delete D y Delete C Delete E Delete-G lDelete H Delete. F

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.