arpitP's blog

By arpitP, history, 4 years ago, In English

Hello Codeforces!

Today I was trying to implement the Kruskal's Algorithm and somehow I have implemented the algorithm but I am not sure about the code I have tested it against only two test cases and it is running fine for those two test cases

My implementation

I have used the union-find data structure.

Can you please help check my code and say whether it's correct or not whether will it give the correct output aginst all the test case

and if it's correct can I optimize it any more?

Any suggestion, ideas, or criticism will be highly welcomed. Thank You!!

  • Vote: I like it
  • -3
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +4 Vote: I do not like it

there is a judge for minimum spanning tree problem in codeforces EDU:
spanning tree
you can submit it there and check if your code is correct.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    sorry but I couldn't find it

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      the link doesn't work?
      can't you find it manually?
      EDU -> DSU -> step 2 -> practice -> problem E.