Kruksal's algorithm code

last of lecture while submitting solution to spoj.com for poroblem MST , sir modify addEdge () function .He say in the question nodes are indexing from [1,2,3…]
but adding edeges using g.addEdge(x-1,y-1,w).correct is g.addEdge(x+1,y+1,w).

if nodes are indexed like [1,2,3,4…] and you want to interpret them as they starts form [0,1,2,3…]
you have to add edges like this
g.addEdge(x-1,y-1,w)

i hope you understand
feel free to ask if not

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.