public void Mirror(TreeNode root) {
if (root==null) {
return;
}
mirror(root);
}
public TreeNode mirror(TreeNode node) {
if (node==null) {
return null;
}
TreeNode leftNode = mirror(node.left);
node.left = mirror(node.right);
node.right = leftNode;
return node;
}
网友评论