dfs concise solution
if one tree is smaller than other than we will return false.\nif root->left not equal too root->right and root->left then we will return false as it is impossib
if one tree is smaller than other than we will return false.\nif root->left not equal too root->right and root->left then we will return false as it is impossible to make them same even by swapping.\nsame goes to root->right.\n\n```\nclass Solution {\npublic:\n    bool flipEquiv(TreeNode* root1, TreeNode* root2)\n    {\n        if(!root1 && !root2) return true;\n        \n        if(!root1 && root2 || root1 && !root2)  return false; \n        \n        if(root1->val != root2->val)  return false;\n        \n        return (flipEquiv(root1->left, root2->left) && flipEquiv(root1->right,root2->right))\n             || (flipEquiv(root1->left, root2->right) && flipEquiv(root1->right,root2->left));\n    }\n};\n```\n
['Depth-First Search', 'C++']