Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc — Part 2 MCQs with Explanations
Practice high-yield Computer Science & IT MCQs on Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc — Part 2 with worked academic solutions for PPSC, FPSC, CSS, PMS, NTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
PPSC, FPSC, CSS...
Estimated Time
48 mins
Exam-Level PPSC FPSC CSS PMS NTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
How is the time complexity of BFS affected when the graph is represented using an adjacency matrix?
Correct Answer: Option C — It remains O(V2).
Detailed Academic Explanation:
It remains O(V2). is the correct answer to “How is the time complexity of BFS affected when the graph is represented using an adjacency matrix”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following properties is essential for the efficient implementation of Dijkstra's algorithm?
Correct Answer: Option D — A priority queue or min-heap to extract the minimum distance.
Detailed Academic Explanation:
A priority queue or min-heap to extract the minimum distance. is the correct answer to “Which of the following properties is essential for the efficient implementation of Dijkstra's algorithm”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
In a graph with weights, which algorithm helps in constructing a Minimum Spanning Tree (MST)?
Correct Answer: Option A — Prim's Algorithm or Kruskal's Algorithm
Detailed Academic Explanation:
Prim's Algorithm or Kruskal's Algorithm is the correct answer to “In a graph with weights, which algorithm helps in constructing a Minimum Spanning Tree (MST)”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which traversal algorithm can be used to check if a graph is bipartite?
Correct Answer: Option D — Both BFS and DFS
Detailed Academic Explanation:
Both BFS and DFS is the correct answer to “Which traversal algorithm can be used to check if a graph is bipartite”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
What is a characteristic feature of a Biconnected Graph?
Correct Answer: Option C — It remains connected even after removing any single vertex.
Detailed Academic Explanation:
It remains connected even after removing any single vertex. is the correct answer to “What is a characteristic feature of a Biconnected Graph”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Prim's algorithm can be efficiently implemented using . . . . . . . . for graphs with greater density.
Correct Answer: Option A — d-ary heap
Detailed Academic Explanation:
d-ary heap is the correct answer to “Prim's algorithm can be efficiently implemented using . . . . . . . . for graphs with greater density.”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following is the most commonly used data structure for implementing Dijkstra's Algorithm?
Correct Answer: Option D — Min priority queue
Detailed Academic Explanation:
Min priority queue is the correct answer to “Which of the following is the most commonly used data structure for implementing Dijkstra's Algorithm”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Time Complexity of DFS is? (V - number of vertices, E - number of edges)
Correct Answer: Option A — O(V + E)
Detailed Academic Explanation:
O(V + E) is the correct answer to “Time Complexity of DFS is? (V - number of vertices, E - number of edges)”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Who proposed the modern formulation of Floyd-Warshall Algorithm as three nested loops?
Correct Answer: Option D — Peter Ingerman
Detailed Academic Explanation:
Peter Ingerman is the correct answer to “Who proposed the modern formulation of Floyd-Warshall Algorithm as three nested loops”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following branch and bound strategy leads to breadth first search?
Correct Answer: Option B — FIFO branch and bound
Detailed Academic Explanation:
FIFO branch and bound is the correct answer to “Which of the following branch and bound strategy leads to breadth first search”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which data structure is most suitable for implementing best first branch and bound strategy?
Correct Answer: Option C — priority queue
Detailed Academic Explanation:
priority queue is the correct answer to “Which data structure is most suitable for implementing best first branch and bound strategy”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
The time taken to compute the transitive closure of a graph is Theta(n 2 ).
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “The time taken to compute the transitive closure of a graph is Theta(n 2 ).”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Correct Answer: Option C — Equivalent to number of indegree of the node
Detailed Academic Explanation:
Equivalent to number of indegree of the node is the correct answer to “In BFS, how many times a node is visited”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Consider the graph M with 3 vertices. Its adjacency matrix is shown below. Which of the following is true? \[{\text{M}} = \left[ {\begin{array}{*{20}{c}} 0&1&1 \\ 1&0&1 \\ 1&1&0 \end{array}} \right]\]
Correct Answer: Option C — Graph M has 3 distinct minimum spanning trees, each of cost 2
Detailed Academic Explanation:
Graph M has 3 distinct minimum spanning trees, each of cost 2 is the correct answer to “Consider the graph M with 3 vertices. Its adjacency matrix is shown below. Which of the following is true? \[{\text{M}} = \left[ {\begin{array}{*{20}{c}} 0&1&1 \\ 1&0&1 \\ 1&1&0 \end{array}} \right]\]”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following is not a branch and bound strategy to generate branches?
Correct Answer: Option D — Highest cost branch and bound
Detailed Academic Explanation:
Highest cost branch and bound is the correct answer to “Which of the following is not a branch and bound strategy to generate branches”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Complete the program. n=rows[W] D(0)=W for k=1 to n do for i=1 to n do for j=1 to n do ___________ return D(n)
Correct Answer: Option C — dij(k)=min(dij(k-1), dik(k-1) + dkj(k-1))
Detailed Academic Explanation:
dij(k)=min(dij(k-1), dik(k-1) + dkj(k-1)) is the correct answer to “Complete the program. n=rows[W] D(0)=W for k=1 to n do for i=1 to n do for j=1 to n do ___________ return D(n)”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
What approach is being followed in Floyd Warshall Algorithm?
Correct Answer: Option D — Dynamic Programming
Detailed Academic Explanation:
Dynamic Programming is the correct answer to “What approach is being followed in Floyd Warshall Algorithm”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
What is the basic principle behind Bellmann Ford Algorithm?
Correct Answer: Option D — Relaxation
Detailed Academic Explanation:
Relaxation is the correct answer to “What is the basic principle behind Bellmann Ford Algorithm”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following is not the algorithm to find the minimum spanning tree of the given graph?
Correct Answer: Option D — Bellman-Ford algorithm
Detailed Academic Explanation:
Bellman-Ford algorithm is the correct answer to “Which of the following is not the algorithm to find the minimum spanning tree of the given graph”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Bellmann ford algorithm provides solution for . . . . . . . . problems.
Correct Answer: Option D — Single source shortest path
Detailed Academic Explanation:
Single source shortest path is the correct answer to “Bellmann ford algorithm provides solution for . . . . . . . . problems.”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Floyd Warshall's Algorithm is used for solving . . . . . . . .
Correct Answer: Option A — All pair shortest path problems
Detailed Academic Explanation:
All pair shortest path problems is the correct answer to “Floyd Warshall's Algorithm is used for solving . . . . . . . .”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which algorithm is used to find the least cost path from source node to destination node?
Correct Answer: Option D — B* BFS
Detailed Academic Explanation:
B* BFS is the correct answer to “Which algorithm is used to find the least cost path from source node to destination node”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
When the Breadth First Search of a graph is unique?
Correct Answer: Option B — When the graph is a Linked List
Detailed Academic Explanation:
When the graph is a Linked List is the correct answer to “When the Breadth First Search of a graph is unique”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which data structure is used for implementing a FIFO branch and bound strategy?
Correct Answer: Option B — queue
Detailed Academic Explanation:
queue is the correct answer to “Which data structure is used for implementing a FIFO branch and bound strategy”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Bellmann Ford algorithm was first proposed by . . . . . . . .
Correct Answer: Option B — Alfonso Shimbe
Detailed Academic Explanation:
Alfonso Shimbe is the correct answer to “Bellmann Ford algorithm was first proposed by . . . . . . . .”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Depth First Search is equivalent to which of the traversal in the Binary Trees?
Correct Answer: Option A — Pre-order Traversal
Detailed Academic Explanation:
Pre-order Traversal is the correct answer to “Depth First Search is equivalent to which of the traversal in the Binary Trees”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Choose the incorrect statement about DFS and BFS from the following?
Correct Answer: Option B — DFS is equivalent to post order traversal in trees
Detailed Academic Explanation:
DFS is equivalent to post order traversal in trees is the correct answer to “Choose the incorrect statement about DFS and BFS from the following”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following can traverse the state space tree only in DFS manner?
Correct Answer: Option D — backtracking
Detailed Academic Explanation:
backtracking is the correct answer to “Which of the following can traverse the state space tree only in DFS manner”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
What is the running time of Bellmann Ford Algorithm?
Correct Answer: Option D — O(VE)
Detailed Academic Explanation:
O(VE) is the correct answer to “What is the running time of Bellmann Ford Algorithm”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Dijkstra's Algorithm cannot be applied on . . . . . . . .
Correct Answer: Option B — Graphs having negative weight function
Detailed Academic Explanation:
Graphs having negative weight function is the correct answer to “Dijkstra's Algorithm cannot be applied on . . . . . . . .”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Dijikstra's Algorithm is more efficient than Bellmann Ford Algorithm.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Dijikstra's Algorithm is more efficient than Bellmann Ford Algorithm.”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
The maximum number of times the decrease key operation performed in Dijkstra's algorithm will be equal to . . . . . . . .
Correct Answer: Option B — Total number of edges
Detailed Academic Explanation:
Total number of edges is the correct answer to “The maximum number of times the decrease key operation performed in Dijkstra's algorithm will be equal to . . . . . . . .”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
What is the formula to compute the transitive closure of a graph?
Correct Answer: Option B — tij(k) = tij(k-1) OR (tik(k-1) AND tkj(k-1))
Detailed Academic Explanation:
tij(k) = tij(k-1) OR (tik(k-1) AND tkj(k-1)) is the correct answer to “What is the formula to compute the transitive closure of a graph”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
A graph is said to have a negative weight cycle when?
Correct Answer: Option C — The total weight of the graph is negative
Detailed Academic Explanation:
The total weight of the graph is negative is the correct answer to “A graph is said to have a negative weight cycle when”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Correct Answer: Option B — When the graph is a Linked List
Detailed Academic Explanation:
When the graph is a Linked List is the correct answer to “When the Depth First Search of a graph is unique”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
How many times the for loop in the Bellmann Ford Algorithm gets executed?
Correct Answer: Option B — V-1
Detailed Academic Explanation:
V-1 is the correct answer to “How many times the for loop in the Bellmann Ford Algorithm gets executed”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
How many priority queue operations are involved in Dijkstra's Algorithm?
Correct Answer: Option B — 3
Detailed Academic Explanation:
3 is the correct answer to “How many priority queue operations are involved in Dijkstra's Algorithm”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
The travelling salesman problem can be solved using . . . . . . . .
Correct Answer: Option B — A minimum spanning tree
Detailed Academic Explanation:
A minimum spanning tree is the correct answer to “The travelling salesman problem can be solved using . . . . . . . .”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Bellmann Ford algorithm is used to indicate whether the graph has negative weight cycles or not.
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Bellmann Ford algorithm is used to indicate whether the graph has negative weight cycles or not.”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
Which of the following is not an application of Breadth First Search?
Correct Answer: Option D — Path Finding
Detailed Academic Explanation:
Path Finding is the correct answer to “Which of the following is not an application of Breadth First Search”. This question is standard in competitive examination syllabi for Graph Algorithms _Dfs_ Bfs_ Dijkstras_ Etc.
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.