For the problems in this set, refer to the following directed graph. When iterating over neighbors, process nodes in sorted (ascending) numerical order.
DFS(0)
and write the nodes in the order they’re visited.BFS(0)
and write the nodes in the order they’re visited.