Share my recursive C++ solution,easy to understand
class Solution {\n    public:\n        bool isSymmetric(TreeNode* root) {\n            if (root == NULL)\n                return true;\n            \n          
    class Solution {\n    public:\n        bool isSymmetric(TreeNode* root) {\n            if (root == NULL)\n                return true;\n            \n            return checkSymmetric(root->left, root->right);\n        }\n        //check the two nodes in symmetric position\n        bool checkSymmetric(TreeNode *leftSymmetricNode, TreeNode *rightSymmetricNode)\n        {\n            if (leftSymmetricNode == NULL && rightSymmetricNode == NULL)\n                return true;\n            if (leftSymmetricNode == NULL || rightSymmetricNode == NULL)\n                return false;\n            if (leftSymmetricNode->val == rightSymmetricNode->val)\n                return checkSymmetric(leftSymmetricNode->left, rightSymmetricNode->right) && checkSymmetric(leftSymmetricNode->right, rightSymmetricNode->left);\n            return false;\n        }\n    };
['C++']