Breadth-First Search / BFS
One of the ways to traverse a graph
Time Complexity
In general, on a graph \(G = (V, E)\), BFS will run in \(O(|V| + |E|)\) time.
Implementation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
One of the ways to traverse a graph
In general, on a graph \(G = (V, E)\), BFS will run in \(O(|V| + |E|)\) time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |