Recursive and non-recursive solutions in Python
Recursive solution (68ms):\n\n    class Solution(object):\n        def isSymmetric(self, root):\n            if not root:\n                return True\n        
Recursive solution (68ms):\n\n    class Solution(object):\n        def isSymmetric(self, root):\n            if not root:\n                return True\n            return self.equals(root.left, root.right)\n        \n        def equals(self, node1, node2):\n            if not node1 and not node2:\n                return True\n            elif node1 and node2 and node1.val == node2.val:\n                return self.equals(node1.left, node2.right) and self.equals(node1.right, node2.left)\n            else:\n                return False\n\nNon-Recursive solution (52ms):\n\n    class Solution(object):\n        def isSymmetric(self, root):\n            if not root:\n                return True\n            stack = []\n            stack.append((root.left, root.right))\n            \n            while stack:\n                left, right = stack.pop()\n                if not left and not right:\n                    continue\n                elif left and right and left.val == right.val:\n                    stack.append((left.left, right.right))\n                    stack.append((left.right, right.left))\n                else:\n                    return False\n            \n            return True
['Recursion']