conversations on all interesting things related to technology and innovation ...

in collaboration with

Uninformed Search – BFS and DFS

Share |

Breadth first search is a strategy in which root node is expanded first and then all successors are expanded. It means that all the nodes at a given depth are expanded before any other node at the next depth level can be expanded. While expanding the nodes the information of the successors needs to be stored in the memory so that in the next iteration those particular nodes can be expanded.

Binary tree, BFS and DFS traversal

For the given tree the BFS expansion will be :

1 2 3 4 5 6 7 8 9 10 11 12
Read more…

,