Determine if a tree is a BFS Tree of a graph

  Kiến thức lập trình

Given an undirected graph and a tree(represented as a parent array), how can you determine if the given tree can be generated by applying Breadth-First Search on the given graph? Are there specific properties of BFS traversal that can be used to identify contradictions?

New contributor

juferrne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT