c - Is a Tree constructed by Breadth-First Search a Binary Tree? -


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 :

enter image description here

by breadth first search of following graph:

enter image description here

here, node franfurt in bfs tree have 3 childs, hence definition of binary tree violated.

thus, tree constructed bfs not binary tree.


Comments