(int u, int v, int cost)
| 74 | } |
| 75 | |
| 76 | public void addEdge(int u, int v, int cost){ |
| 77 | this.adjList.get(u).add(new AdjNode(u, v, cost)); |
| 78 | this.adjList.get(v).add(new AdjNode(v, u, cost)); |
| 79 | } |
| 80 | public void printGraph(){ |
| 81 | for(int i = 0 ; i < this.v ; i++){ |
| 82 | System. out.print(i + " -> "); |