Figure 7.11: Breadth-first search of the digraph in Figure 7.11
The complexity of both DFS and BFS is O(e).
Implementation of Breadth-First Search