Clean and simple java code
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:\nO(n)\n- Space complexity:\nO(n)\n# Code\n```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public boolean flipEquiv(TreeNode root1, TreeNode root2) {\n        if(root1==null&&root2==null)\n        return true;\n        if(root1==null||root2==null)\n        return false;\n        if(root1.val!=root2.val)\n        return false;\n        boolean left= flipEquiv(root1.left,root2.left)||flipEquiv(root1.left,root2.right);\n        boolean right=flipEquiv(root1.right,root2.right)||flipEquiv(root1.right,root2.left);\n        return left&&right;\n    }\n}\n```
['Java']