Graph Practice Questions
Six warm-up problems that exercise the representation — building a graph, counting edges, identifying components, modeling problems — without any heavyweight traversal yet. The traversal-heavy classics (Number of Islands, Course Schedule, Clone Graph, etc.) are on Day 10.
Think of today as boot camp for the graph model. By the end you should feel comfortable taking an edge list, picking the right representation, and answering basic structural questions in O(V + E).
Easy
| Problem | Pattern | Status |
|---|---|---|
| Find Center of Star Graph | Degree counting | Available |
| Find the Town Judge | In/out degree counting | Available |
| Find if Path Exists in a Graph | DFS / BFS / Union-Find | Available |
Medium
| Problem | Pattern | Status |
|---|---|---|
| Number of Connected Components in an Undirected Graph | DFS sweep / Union-Find | Available |
| Keys and Rooms | Reachability via DFS/BFS | Available |
| Min Vertices to Reach All Nodes in a DAG | In-degree counting | Available |
More Practice (Coming Soon — Day 10)
These problems use BFS / DFS heavily — you’ll meet them on Day 10 once we’ve covered the traversal algorithms properly.
| Problem | Pattern | Status |
|---|---|---|
| Number of Islands | DFS / BFS over a grid | Available on Day 10 |
| Clone Graph | DFS with hash-map memo | Available on Day 10 |
| Course Schedule | Cycle detection in directed graph | Available on Day 10 |
| Word Ladder | BFS on word transformations | Available on Day 10 |
| Max Area of Island | DFS area accumulation | Available on Day 10 |
| Rotting Oranges | Multi-source BFS | Available on Day 4 |