GF3: Depth-first search

San Skulrattanakulchai

November 5, 2018

Idea

Conceptualization of DFS

Notes

Exercises

  1. Write a DFS algorithm to find the connected components of an undirected graph.
  2. Write a DFS algorithm to solve the Reachability Problem.
  3. Write a DFS algorithm to test whether a given undirected graph is bipartite.
  4. Write a DFS algorithm to test whether a given directed graph contains a cycle.
  5. Write a DFS algorithm to test whether a given undirected graph contains a cycle.