finish BFS
finish DFS