Back to Browse

Breadth First Search (BFS) Algorithm in Hindi with Example

110.9K views
May 8, 2018
18:46

Breadth First Search (BFS) algorithm traverses a graph in a breadth ward motion. BFS algorithm uses Queue data structure. BFS Algorithm: START Step 1 − Visit the starting vertex and mark it as visited. Display it. Set a pointer to the starting vertex.(Currently working Vertex.) Step 2 − if( Currently working Vertex has adjacent unvisited vertex ) { Visit the adjacent unvisited vertex and Mark it as visited. Insert it in a queue. (enqueue) Display it. } else{ Update the pointer to the first element of queue. Remove the first element from queue. (dequeue) } (repeat rule 2 until the queue is empty) END If you have any doubts please comment. Don't forget to Share and Subscribe. Email: [email protected] facebook: https://www.facebook.com/sourav.s.nag Twitter: https://twitter.com/SRN9999

Download

1 formats

Video Formats

360pmp423.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Breadth First Search (BFS) Algorithm in Hindi with Example | NatokHD