题目描述:交换二叉树中所有节点的左右子树
function Node(key) {
this.key = key;
this.left = null;
this.right = null;
}
function swap(node) {
if(node == null)
return
let tempNode = new Node(null)
tempNode = node.left
node.left = node.right
node.right = tempNode
swap(node.left)
swap(node.right)
}