1. What is an adjacency matrix?
(A) A 1D array representing graph edges
(B) A 2D array representing graph connections
(C) A list of edges
(D) A tree structure
2. Which representation is more space-efficient for sparse graphs?
(A) Adjacency matrix
(B) Adjacency list
(C) Both are equally efficient
(D) None of the above
3. In an adjacency matrix, what does a value of 1 indicate?
(A) No edge exists
(B) An edge exists
(C) The graph is directed
(D) The graph is weighted
4. What is the time complexity of checking for the existence of an edge using an adjacency matrix?
(A) O(1)
(B) O(n)
(C) O(n²)
(D) O(log n)
5. What is the primary disadvantage of using an adjacency matrix for graph representation?
(A) It is complex to implement
(B) It uses too much memory for sparse graphs
(C) It does not support weighted graphs
(D) It cannot represent directed graphs
6. Which of the following is true about adjacency lists?
(A) They require more memory than adjacency matrices
(B) They can represent both directed and undirected graphs
(C) They are slower for edge existence checks
(D) They cannot represent weighted graphs
7. For a complete graph with n vertices, what is the size of the adjacency matrix?
(A) n
(B) n²
(C) n(n−1)/2
(D) 2n
8. How can you represent weights in an adjacency matrix?
(A) Use negative numbers
(B) Replace 1s with the weight values
(C) Add an extra row
(D) Use a separate array
9. What is the time complexity of traversing all vertices in an adjacency list?
(A) O(1)
(B) O(n)
(C) O(n + e) where e is the number of edges
(D) O(n²)
10. Which representation is more suitable for dense graphs?
(A) Adjacency list
(B) Adjacency matrix
(C) Edge list
(D) None of the above