BS [Chapter 22.3-22.4]: Depth first search and topological sort