BFS( Breadth First Search for Graph)

preview_player
Показать описание
BFS( Breadth First Search for Graph) is a traversing algorithm and is one of the ways which is commonly used in traversing Graphs & Trees, where you should start traversing from a selected node (source or starting node) and traverse the graph or tree level wise.

Рекомендации по теме
Комментарии
Автор

Queuing 3 again as the neighbor elements of 2 is really unnecessary. "You only queue elements which have NOT been visited!" This makes coding the algorithm easier.

tebohomokoena