Please find the error in my code

kruskals algo for MST

@Usha24 pass v+1 to constructor (if node numbering starts from 0).
also when uniting, also set rank as 0 for the one you are changing the parent!

Not able to understand, please can you elaborate

@Usha24 see this updated code

the ques in the course contains nodes from 0 to n-1 only, also my code was running for 5 test cases

for the remaining i was getting runtime error

@Usha24


works fine

yes working now , thanks