Breadth-First Search
Explore level by level from a starting point, the go-to way to find the shortest path in an unweighted graph.
Breadth-First Search Practice Problems
Easy
2 problemsMedium
4 problems- 39medium
Binary Tree Level Order Traversal
Return the values of a tree grouped level by level, from top to bottom.
- 40medium
Rotting Oranges
Find the minimum time for rot to spread to every fresh orange in a grid.
- 41medium
01 Matrix
Find the distance from every cell in a grid to its nearest zero.
- 42medium
Shortest Path in Binary Matrix
Find the shortest path from the top-left to the bottom-right cell of a grid.
Hard
2 problemsRelated concepts
| Topic | Description |
|---|---|
| Depth-First Search | Explore as far as possible down one path before backtracking, used to walk trees, graphs, and grids. |
| Queues | First-in, first-out collection for scheduling, BFS, and buffering. |
| Graphs | Nodes and edges modeling networks, dependencies, and paths. |
| Trees | Hierarchical nodes with parent–child links for ordered and nested data. |
| Dijkstra's Algorithm | Find the shortest path from a starting node to every other node in a graph where edges have non-negative weights. |
| Bellman-Ford Algorithm | Find the shortest path from a starting node even when some edges have negative weights, and detect negative cycles. |