Sort the list below in the order that reconstructs the BFS procedure.
Breadth-first search
Reconstructing the algorithm
Report a typo
Put the items in the correct order
Consider all unvisited neighbours of the nodes visited at the previous step.
Repeat the previous steps until all the nodes are visited.
Choose one node of a graph as initial. Mark it as visited. Set its distance to .
Mark all such nodes as visited and set their distances to , where is the distance to the nodes visited at the previous step.
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.