Google Interview Question

DFS related problem and binary tree