Facebook

breadth first search

Breadth First Search in Graphs

Breadth First Search is a technique to visit all the nodes of graph in a well-defined way.This technique can be applied  to  directed,undirected,weighted or unweighted  graph.Queues are used as a data structure to store elements. BFS traverses all the nodes and edges of graph. BFS in graph with m vertices and n edges takes O(n+m) time…. read more »

Sidebar