結果 : bfs and dfs in javascript