Ingersoll Rand Interview Question

Bfs dfs compare and run