3 Liner || DFS || Simply Try all ways || C++
\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if(!root1 and !root2) return true;\n        if(!root1 or !root2) return false;\n        if(roo
```\n    bool flipEquiv(TreeNode* root1, TreeNode* root2) {\n        if(!root1 and !root2) return true;\n        if(!root1 or !root2) return false;\n        if(root1->val!=root2->val) return false;\n        bool l = flipEquiv(root1->left,root2->left) and flipEquiv(root1->right,root2->right);\n        bool r = flipEquiv(root1->left,root2->right) and flipEquiv(root1->right,root2->left);\n        return l or r;\n    }\n```
['Depth-First Search', 'Recursion']