COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Save space
|
|
Keep the locations in sequence
|
|
To make it easier to read
|
|
utilise the internal language data structure
|
Detailed explanation-1: -An adjacency matrix is a way of representing a graph as a matrix of booleans (0’s and 1’s). A finite graph can be represented in the form of a square matrix on a computer, where the boolean value of the matrix indicates if there is a direct path between two vertices.
Detailed explanation-2: -The adjacency matrix [55, 56] is a matrix used to represent finite graphs. The values in the matrix show whether pairs of nodes are adjacent to each other in the graph structure. If the graph is undirected, then the adjacency matrix will be a symmetric one.
Detailed explanation-3: -In Adjacency List, we use an array of a list to represent the graph. The list size is equal to the number of vertex(n). Adjlist[0] will have all the nodes which are connected to vertex 0. Adjlist[1] will have all the nodes which are connected to vertex 1 and so on.
Detailed explanation-4: -Adjacency Matrix: Adjacency Matrix is a 2D array of size V x V where V is the number of vertices in a graph. Let the 2D array be adj[][], a slot adj[i][j] = 1 indicates that there is an edge from vertex i to vertex j. Adjacency matrix for undirected graph is always symmetric.