Question 15

Computer Awareness Graphs Medium

Consider the task of finding the shortest path in an unweighted graph by using BFS and DFS. Which of the following statements are true? $$ \text{ (A) BFS always finds the shortest path } $$ $$ \text{ (B). DFS always finds the shortest path.} $$ $$ \text{ (C). DFS does not guarantee finding the shortest path } $$ $$ \text{ (D). BFS does not guarantee finding the shortest path } $$

(A) (B) and (D) only.
(B) (A) and (C) only
(C) (A) and (B) only
(D) (C) and (D) only
✓ Correct Answer: Option B Verified Solution

📘 Step-by-Step Solution & Detailed Explanation:

Solution:

In an unweighted graph, the cost of every edge is the same (i.e., each edge has weight 1).

- BFS (Breadth First Search): BFS explores all neighbors level by level. Therefore, the first time it reaches a vertex, it must be through the shortest path (minimum number of edges).
⇒ BFS always finds the shortest path.

- DFS (Depth First Search): DFS goes deep into one path before exploring alternatives. This may result in reaching a node via a longer path first, even though a shorter path exists.
⇒ DFS does not guarantee the shortest path.

✅ Correct Answer: (A) and (C) only

Practice Similar Graphs Questions

Reinforce your conceptual grasp with related questions from CUET-MCA 2025:

Q37 Which of the following is not an application of DFS?
Solve →
Q52 Which of the following statements are TRUE, where E represents the number...
Solve →
Q1 Match List-I with List-II |c|l| List-I & List-II \\ (A)\ Seek Time & (I)\...
Solve →
Q4 In case of Binary search tree which of the following procedure's running...
Solve →
Q7 External fragmentation occurs
Solve →
Full-Length Test Series

Prepare for CUET-MCA Under Real Exam Conditions

Take timed full-length mock tests with authentic question distributions, negative marking (+12/-3 in Math), and instant All India Rank calculation.

Start Free Mock Test Series →