Consider the tree arcs of a BFS traversal from a source node W in an unweighted, connected, undirected graph. The tree T formed by the tree arcs is a data structure for computing
A
The shortest path between every pair of vertices.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
The shortest path from W to only those nodes that are leaves of T.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
The shortest path from W to every vertex in the graph
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
The longest path in the graph.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is C The shortest path from W to every vertex in the graph
BFS traversal from W gives the shortest path from W to every other vertex in the graph.