algorithm BFS and DFS