()
| 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 + " -> "); |
| 83 | for(int j = 0 ; j < adjList.get(i).size(); j++){ |
| 84 | System.out.print(adjList.get(i).get(j).dest + " "); |
| 85 | } |
| 86 | System. out.println(); |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | class AdjNode{ |