struct Tree() { int val; Tree *left, *right; Tree(int a): val(a), left(NULL), right(NULL){} } bool mirrorTree(Tree *root){ if(root == NULL || (root->left== NULL && root->right == NULL)) return NULL ; Tree *tp = root->left; root->left = root->right; root->right = tp; if(root->left) mirrorTree(root->left); if(root->right) mirrorTree(root->right); }