What is the exact difference between Dijkstra\'s and Prim\'s algorithms? I know Prim\'s will give a MST but the tree generated by Dijkstra will also be a MST. Then what is
Dijkstra's algorithm doesn't create a MST, it finds the shortest path.
Consider this graph
5 5 s *-----*-----* t \ / ------- 9
The shortest path is 9, while the MST is a different 'path' at 10.