#include <iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
bool isUnivalTree(TreeNode* root) {
if(!root) return true;
int v = root->val;
return dfs(root, v);
}
private:
bool dfs(TreeNode* root, int v){
if(!root) return true;
return root->val == v && dfs(root->left, v) && dfs(root->right, v);
}
};
int main() {
return 0;
}