Q. What is a key characteristic of DFS compared to BFS?
A.
DFS uses less memory than BFS.
B.
DFS explores all neighbors before going deeper.
C.
DFS can be implemented using recursion.
D.
DFS guarantees the shortest path.
Solution
A key characteristic of DFS is that it can be implemented using recursion, allowing it to explore as far as possible along each branch before backtracking.
Correct Answer:
C
— DFS can be implemented using recursion.
Q. Which traversal method can be used to find the shortest path in an unweighted graph?
A.
DFS
B.
BFS
C.
Dijkstra's Algorithm
D.
A* Search
Solution
BFS can be used to find the shortest path in an unweighted graph because it explores all neighbors at the present depth prior to moving on to nodes at the next depth level.