[C++] Similar to Same Tree Problem
\nclass Solution {\npublic:\n\n    bool flipEquiv(TreeNode* p, TreeNode* q) {\n        if (p == NULL && q == NULL) return true;\n        // one of p and q is nu
```\nclass Solution {\npublic:\n\n    bool flipEquiv(TreeNode* p, TreeNode* q) {\n        if (p == NULL && q == NULL) return true;\n        // one of p and q is null\n        if (q == NULL || p == NULL) return false;\n        if (p->val != q->val) return false;\n        return (flipEquiv(p->left,q->left) && flipEquiv(p->right,q->right)) ||  (flipEquiv(p->left,q->right) && flipEquiv(p->right,q->left));\n    }\n};\n\n// if you liked the solution then please upvote it so that it can reach to more people \n// If you have any doubt or want to discuss any thing related to solution please leave a comment, so that all of the viewers can discuss it\n```
['Tree', 'C']