Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the maximum number of edges present in a simple directed graph with 7 vertices if there exists no cycles in the graph?

A. 21
B. 7
C. 6
D. 49
Answer» D. 49
2.

What would be the DFS traversal of the given Graph?

A. ABCED
B. AEDCB
C. EDCBA
D. ADECB
Answer» B. AEDCB
3.

Dijkstra’s Algorithm will work for both negative and positive weights?

A. True
B. False
Answer» C.
4.

What is the maximum possible number of edges in a directed graph with no self loops having 8 vertices?

A. 28
B. 64
C. 256
D. 56
Answer» E.
5.

Assuming value of every weight to be greater than 10, in which of the following cases the shortest path of a directed weighted graph from 2 vertices u and v will never change?

A. add all values by 10
B. subtract 10 from all the values
C. multiply all values by 10
D. in both the cases of multiplying and adding by 10
Answer» D. in both the cases of multiplying and adding by 10
6.

All Graphs have unique representation on paper.

A. True
B. False
Answer» C.
7.

Floyd Warshall Algorithm used to solve the shortest path problem has a time complexity of __________

A. O(V*V)
B. O(V*V*V)
C. O(E*V)
D. O(E*E)
Answer» C. O(E*V)
8.

What is the number of unlabeled simple directed graph that can be made with 1 or 2 vertices?

A. 2
B. 4
C. 5
D. 9
Answer» C. 5
9.

A graph having an edge from each vertex to every other vertex is called a ___________

A. Tightly Connected
B. Strongly Connected
C. Weakly Connected
D. Loosely Connected
Answer» B. Strongly Connected
10.

Dijkstra’s Algorithm will work for both negative and positive weights?

A. True
B. False
Answer» C.