Representation of Graphs: Adjacency Matrix and Adjacency List
Adjacency Matrix A graph G = (V, E) where v= {0, 1, 2, . . . n-1} can be represented using two dimensional integer array of size n x n. int adj[20][20] can be used to store a graph with 20 vertices adj[i][j] = 1, indicates presence of edge between two vertices i and j. …
Representation of Graphs: Adjacency Matrix and Adjacency List Read More »