(int v)
| 66 | int v; |
| 67 | List<ArrayList<AdjNode>> adjList; |
| 68 | Graph(int v){ |
| 69 | this.v = v; |
| 70 | adjList = new ArrayList<>(); |
| 71 | for(int i = 0; i < this.v; i++){ |
| 72 | adjList.add(new ArrayList<>()); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | public void addEdge(int u, int v, int cost){ |
| 77 | this.adjList.get(u).add(new AdjNode(u, v, cost)); |