* Definition for a binary tree node.
* function TreeNode(val) {
* this.left = this.right = null;
var invertTree = function (root) {
// const left = root.left;
// const right = root.right;
// root.right = invertTree(left);
// root.left = invertTree(right);
// 其实这里使用队列也是一样的,因为这里顺序不重要
while ((current = stack.shift())) {
const left = current.left;
const right = current.right;