Java recursive 0ms 100% clean soln
\nclass Solution {\n    \n    public boolean flipEquiv(TreeNode root1, TreeNode root2) {\n        \n        if(root1 == null && root2 == null) return true;\n   
```\nclass Solution {\n    \n    public boolean flipEquiv(TreeNode root1, TreeNode root2) {\n        \n        if(root1 == null && root2 == null) return true;\n        if(root1 == null || root2 == null) return false;\n        if(root1.val != root2.val) return false;\n        \n        if (flipEquiv(root1.left, root2.left) && flipEquiv(root1.right, root2.right)) {\n            return true;\n        }\n        \n        else if (flipEquiv(root1.left, root2.right) && flipEquiv(root1.right, root2.left)) {\n            return true;\n        }\n        \n        else {\n            return false;\n        }\n    }\n}\n```
['Depth-First Search', 'Recursion', 'Java']