i studying breadth-first search. wanted ask: tree constructed breadth-first search (i.e., bfs tree, wherein store each node's predecessor) binary tree?
the tree constructed breadth first search not necessarily binary tree.
according wikipedia,a binary tree tree data structure in each node has at 2 child nodes.
the node(s) of tree constructed bfs
may contain any number of child nodes
.
example:
following tree obtained :
by breadth first search
of following graph:
here, node franfurt
in bfs tree have 3 childs, hence definition of binary tree violated.
thus, tree constructed bfs
not binary tree.
Comments
Post a Comment