Exercises - Lecture 17

For the problems in this set, refer to the following directed graph. When iterating over neighbors, process nodes in sorted (ascending) numerical order.

  1. Assume all nodes are unvisited. Which nodes are explorable from 0?
  2. Assume all nodes are unvisited. Which nodes are explorable from 4?
  3. Run DFS(0) and write the nodes in the order they’re visited.
  4. Run BFS(0) and write the nodes in the order they’re visited.