dfs that takes a node as an argument.None, return False (base case for null nodes).True if its value is 1, otherwise return False.dfs on the left and right children of the node to evaluate them.dfs with the root node and return its result as the final answer.