bfs and dfs OK