themechanicalcoder's blog

By themechanicalcoder, history, 6 years ago, In English

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

Full text and comments »

By themechanicalcoder, history, 6 years ago, In English

Hey guys I have found a very good youtube playlist to learn C++ STL hope you find it helpful here is the link https://www.youtube.com/playlist?list=PL5jc9xFGsL8G3y3ywuFSvOuNm3GjBwdkb

Full text and comments »