Breadth First Search
Breadth-first search visits vertices in order of distance from the start, using a queue. On an unweighted graph the first time you reach a vertex is a shortest path.
Costs
| Category | Algorithm |
| Difficulty | Medium |
| Time, adjacency list | O(V + E) |
| Time, adjacency matrix | O(V²) |
| Queue | O(V) |
Questions
What is Breadth First Search?
Breadth-first search visits vertices in order of distance from the start, using a queue. On an unweighted graph the first time you reach a vertex is a shortest path.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.