2. BFS Definition:
BFS is an algorithm for traversing or searching tree
or graph data structures.
BFS Algorithm:
1.We pointed start vertice as level zero.
2.Starting from start vertice we visited all the
vertices that are at the distance of one edge away.
these vertices pointed as level one from the start
vertice and mark as visited.
3. 3. we again visited all the new vertices that are at
the distance of one edge away from the level one.
these vertices pointed as level two and mark as
visited .
4.The process is continue until all the vertice mark
as visited.