What is the main advantage of using a priority queue in Dijkstra's algorithm?
-
It allows for faster insertion of nodes
-
It ensures that the node with the smallest distance is processed next
-
It reduces the space complexity
-
It simplifies the implementation