Practice: Graph search: BFS and DFS
0 of 4 solved
About these problems
Apply, Connect, Reason and Stretch describe difficulty within this topic, not an official contest rating. Open any problem in any order; reading the chapter first is optional.
- 1Reachable stationsAn undirected graph has n stations. Count the stations reachable from station 1, including station 1 itself.ApplyNot started
- 2Minimum hopsFind the minimum number of edges from station 1 to every vertex of an undirected graph. Print -1 for unreachable vertices.ConnectNot started
- 3Open regionsCount connected regions of free cells in a grid. Cells connect only through a shared side, not diagonally.ReasonNot started
- 4Two compatible groupsDecide whether the vertices of an undirected graph can be labeled A or B so that every edge joins different labels.StretchNot started