0 ms, faster than 100.00% of Java online submissions
Runtime: 0 ms, faster than 100.00% of Java online submissions for Symmetric Tree.\nMemory Usage: 37.4 MB, less than 74.15% of Java online submissions for Symmet
Runtime: 0 ms, faster than 100.00% of Java online submissions for Symmetric Tree.\nMemory Usage: 37.4 MB, less than 74.15% of Java online submissions for Symmetric Tree.\n```\nclass Solution {\n    public boolean isSymmetric(TreeNode root) {\n        return root==null || traverse(root.left,root.right);\n    }\n    private boolean traverse(TreeNode one,TreeNode two){\n        if(one==null && two==null)return true;\n        if(one==null || two==null)return false;\n        if(one.val!=two.val)return false;\n        boolean resl=traverse(one.left,two.right);\n        if(!resl)return false;\n        boolean resr=traverse(one.right,two.left);\n        if(!resr)return false;\n        return true;\n    }\n}\n```
['Recursion', 'Java']