Breadth First Search

Another core algorithm used to traverse trees.

Why does the representation of the graph matter when conducting breadth first search?

Is it accurate to say that running DFS and BFS both with an adjacency list is O(n + m) and both on an adjacency matrix is O(n^2)?

How do DFS and BFS both detect cycles?

What is the difference in between back and cross edges and do both DFS and BFS use those terms?

Traversal time Complexity

When the breadth first search is ran on a graph that has an adjacency list, the time complexity is:

Where n is the number of vertices and m is the amount of edges.

Properties

When running BFS, you can determine that a graph is a tree if it has no cross edges, all vertices have one parent, and all the vertices are in one connected graph.