Lab Activity 6.4

AdjacencyMatrixWeightedUndirected.java

public class AdjacencyMatrixWeightedUndirected {
    int[][] adj;

    public AdjacencyMatrixWeightedUndirected(int nodes) {
        this.adj = new int[nodes][nodes];
    }

    public void addEdge(int u, int v, int weight) { 
        // Write your code here
    }

    public int edgeWeight(int u, int v) { 
        // Write your code here
        return 0;
     }
}

Last updated