(int parent[], int graph[][])
| 28 | // A utility function to print the constructed MST stored in |
| 29 | // parent[] |
| 30 | void printMST(int parent[], int graph[][]) |
| 31 | { |
| 32 | System.out.println("Edge \tWeight"); |
| 33 | for (int i = 1; i < V; i++) |
| 34 | System.out.println(parent[i] + " - " + i + "\t" + graph[i][parent[i]]); |
| 35 | } |
| 36 | |
| 37 | // Function to construct and print MST for a graph represented |
| 38 | // using adjacency matrix representation |