Acies LLP Interview Question

execute bfs and dfs code