Simple and Clean Code || C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\n    bool f(TreeNode* root1, TreeNode* root2)\n    {\n        if(root1==NULL && root2!=NULL)\n        {\n            return false;\n        }\n        if(root2==NULL && root1!=NULL)\n        {\n            return false;\n        }\n        if(root1==NULL && root2==NULL)\n        {\n            return true;\n        }\n\n        if(root1->val!=root2->val)\n        return false;\n\n\n        bool a=f(root1->left,root2->left);\n        bool b=f(root1->right,root2->right);\n        bool c=f(root1->left,root2->right);\n        bool d=f(root1->right,root2->left);\n        return (c&&d) || (a&&b);\n\n    }\npublic:\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        return f(root1,root2);\n\n    }\n};\n```
['C++']