construct dfs spanning tree next
if the following are true:
- children of the node top in graph graph = children
- elements of children that are not in tree tree = new_elements
- nodes with values new_elements and parent top = final_elems
- result of dumping final_elems to rest = new_stack
then output of the build_dft_tree function where input graph is graph, tree is tree, and neighbor stack is [ node (top, parent), rest ] = output of the build_dft_tree function where input graph is graph, tree is [ node (top, parent), tree ], and neighbor stack is new_stack
Comments
Please log in to add comments