So easy的事情~~~
var invertTree = function(root) {
if(root===null) return null;
var temp=root.left;
root.left=root.right;
root.right=temp;
invertTree(root.left);
invertTree(root.right);
return root;
};
So easy的事情~~~
var invertTree = function(root) {
if(root===null) return null;
var temp=root.left;
root.left=root.right;
root.right=temp;
invertTree(root.left);
invertTree(root.right);
return root;
};