Breadth First Search
BFS stands for Breadth First Search. It's a graph traversal algorithm for locating a shortest path in graph. It uses a queue data structure which follows FIFO (first in first out).
In BFS, one node is chosen at a time when it is travelled and marked then its adjacent are travelled and stored within the queue.
It's uninformed method because we've got no idea about node distance to seek out out goal.
Note :- It's solve mini problems.
Ex.-
A
/ \
B C
/ \ / \
D E F G
Insert data in queue
Delete data from queue
![]() |
| OUTPUT :- A B C D E F G |


