Graphs line
Graphs problems
Places joined by links, where a walk can lead back to where it started. The problems explore grids and networks, count connected regions and find the fewest steps between two places.
- 12 medium
- 1 hard
The 13 problems
In the order the app teaches them. Each page has the problem, five hints and the explained solution.
- Number of IslandsMedium
- Clone GraphMedium
- Max Area of IslandMedium
- Pacific Atlantic Water FlowMedium
- Surrounded RegionsMedium
- Rotting OrangesMedium
- Walls And GatesMedium
- Course ScheduleMedium
- Course Schedule IIMedium
- Redundant ConnectionMedium
- Number of Connected Components In An Undirected GraphMedium
- Graph Valid TreeMedium
- Word LadderHard
On the roadmap
Graphs is a station on the graphs line. It builds on Backtracking. Next comes Advanced Graphs.
The roadmap says why each line runs in its order.
Patterns
5 patterns solve these problems. Naming them gives the problems’ methods away, so the list is folded.
Show the 5
- Grid connected components3 problems
- Graph traversal with a visited set3 problems
- Breadth-first search by distance3 problems
- Topological ordering2 problems
- Union-find2 problems