Home > Back-end >  Consult some words about kruskal algorithm in the data structure of the parent array of a problem
Consult some words about kruskal algorithm in the data structure of the parent array of a problem

Time:10-08

I want to ask, as the parent array initialized to 0, so if the beginning of an edge is vertices 1, the end is vertex 0, and then to look for in the parent array, respectively is 1 and 0, since let who did the root node, the parent [1]=0, then attached to the edge of the vertices 1, in the search to find array, the parent [1] or less than zero, the return value is 1, how do you explain this
  • Related