MASIGNASUKAv102
6510051498749449419

What is BFS (Breadth first search) in Design and Analysis of Algorithms Tutorial | DAA - Learn With AVRK

Add Comments
Saturday, June 12, 2021

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  

  A 

  B

  C

  D

  E

  F

  G


Delete data from queue 

Loading...
OUTPUT :-    A B C D E F G

 
Learn With AVRK

Learn With AVRK