Given below is Dijkstra's algorithm split by 5 parts. Sort them in the order that reconstructs the initial algorithm.
Dijkstra's algorithm
Reconstructing the algorithm
Report a typo
Put the items in the correct order
Consider all unprocessed neighbours of and update the current distance to each of them to a smaller value.
When all the neighbours of are considered, mark as processed.
Set the current distance to the source to , for all other nodes assign it to . Mark all nodes as unprocessed.
If there are no unprocessed node, the algorithm is finished. Otherwise, go back to the 2nd step.
Find an unprocessed node with the smallest .
___
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.