Need help in a problem

Revision en1, by themechanicalcoder, 2018-10-22 21:25:39

I was solving the problem Uva 10600 in which we have to find the minimum and second minimum spanning tree I found the minimum spanning tree using kruskal's algorithm and stored the edges in a vector mst then to find the second minimum spanning tree I did this

second_tot_wt=INF for edge in mst : second_tot_wt=min(second_tot_wt,total weight of the minimum spanning tree ignoring this edge)

my code was fine on the test case but I am getting the verdict wrong answer can someone please help

my solution

Tags #graph, minimum spanning tree, uvaoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English themechanicalcoder 2018-10-22 21:25:39 730 Initial revision (published)