// In a given binary tree swap right and left node,
// so that the tree will look like:
// 4 4
// / \ / \
// 2 5 => 5 2
// / \ / \
// 1 3 3 1
typedefstruct_TreeNode{struct_TreeNode*pLeft;struct_TreeNode*pRight;//arbitrary
intdata;}TreeNode,*PTreeNode;boolSwapSubtrees(PTreeNoderoot){if(!root){returnfalse;}PTreeNodetmp=root->pRight;root->pRight=root->pLeft;root->pLeft=tmp;if(root->pRight){SwapSubtrees(root->pRight);}if(root->pLeft){SwapSubtrees(root->pLeft);}returntrue;}