Add another application of BFS and DFS