79157756

Date: 2024-11-05 05:34:41
Score: 1.5
Natty:
Report link

The OP refers to the statement made in CLRS with respect to the predecessor subgraph created by the BFS and DFS traversal.

The fact that BFS traversal always gives a BFS tree and not a forest (like in case of DFS) is due to the definition of the predecessor subgraph in case of BFS. It is defined for only one source vertex unlike DFS which is defined for all vertices.

Ref - enter image description here

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Chetan Naik