标签:solution code val class sam public pre treenode col
class Solution { public: bool isSameTree(TreeNode* p, TreeNode* q) { if(p == NULL && q == NULL) return true; else if(p == NULL || q == NULL) return false; if(p->val != q->val) return false; return isSameTree(p->left,q->left) && isSameTree(p->right,q->right); } };
标签:solution code val class sam public pre treenode col
原文地址:https://www.cnblogs.com/ymjyqsx/p/9652913.html