add BFS/DFS