Java
If you like it pls upvote\n\n\n\n public boolean isSymmetric(TreeNode root) {\n  if (root == null) return true;\n  Stack<TreeNode> stack = new Stack<>();\n  sta
If you like it pls upvote\n\n```\n\n public boolean isSymmetric(TreeNode root) {\n  if (root == null) return true;\n  Stack<TreeNode> stack = new Stack<>();\n  stack.push(root.left);\n  stack.push(root.right);\n\n  while (!stack.isEmpty()) {\n   TreeNode n1 = stack.pop();\n   TreeNode n2 = stack.pop();\n\n   if (n1 == null && n2 == null) continue;\n   if (n1 == null || n2 == null || n1.val != n2.val) return false;\n\n   stack.push(n1.left);\n   stack.push(n2.right);\n   stack.push(n1.right);\n   stack.push(n2.left);\n  }\n\n  return true;\n }\n\n\n```
['Java']