DSA Third Unit MCQ
DSA Third Unit MCQ
a) 10
b) 6
c) 16
d) 0
3. What is the maximum number of possible non zero values in an adjacency
matrix of a simple graph with n vertices?
a) (n*(n-1))/2
b) (n*(n+1))/2
c) n*(n-1)
d) n*(n+1)
4. Which of these adjacency matrices represents a simple graph?
a) [ [1, 0, 0], [0, 1, 0], [0, 1, 1] ]
b) [ [1, 1, 1], [1, 1, 1], [1, 1, 1] ]
c) [ [0, 0, 1], [0, 0, 0], [0, 0, 1] ]
d) [ [0, 0, 1], [1, 0, 1], [1, 0, 0] ]
5. Space complexity for an adjacency list of an undirected graph having large
values of V (vertices) and E (edges) is
a) O(E)
b) O(V*V)
c) O(E+V)
d) O(V)
6. Which of the following is true?
a) Prim’s algorithm initialises with a vertex
b) Prim’s algorithm initialises with a edge
c) Prim’s algorithm initialises with a vertex which has smallest edge
d) Prim’s algorithm initialises with a forest
7. Consider the given graph.
What is the weight of the minimum spanning tree using the Prim’s algorithm,
starting from vertex a?
a) 23
b) 28
c) 27
d) 11