careercup 4.2: bfs & dfs