Get your own website
Python
C
Java
 
Python result:
C result:
Java result:
Prim's Algorithm MST:
Edge    Weight
A-D     3
A-B     4
B-C     3
C-H     2
C-E     4
E-G     3
D-F     4
Prim's Algorithm MST:
Edge    Weight
A-D     3
A-B     4
B-C     3
C-H     2
C-E     4
E-G     3
D-F     4
Prim's Algorithm MST:
Edge    Weight
A-D     3
A-B     4
B-C     3
C-H     2
C-E     4
E-G     3
D-F     4