Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph?
(A) In adjacency list representation, space is saved for sparse graphs.
(B) DFS and BSF can be done in O(V + E) time for adjacency list representation. These operations take O(V^2) time in adjacency matrix representation. Here is V and E are number of vertices and edges respectively.
(C) Adding a vertex in adjacency list representation is easier than adjacency matrix representation.
(D) All of the above
Explanation: See https://www.geeksforgeeks.org/graph-and-its-representations/
Quiz of this Question
- Data Structures | Graph | Question 2
- Data Structures | Heap | Question 1
- Data Structures | Queue | Question 11
- Data Structures | Hash | Question 2
- Data Structures | Graph | Question 4
- Advantages of vector over array in C++
- Data Structures and Algorithms | Set 37
- Data Structures and Algorithms | Set 36
- Data Structures | Heap | Question 12
- Data Structures | Linked List | Question 17