function TreeNode(x) { this.val = x; this.left = null; this.right = null; } function Print(pRoot) { //最终输出的结果 let result = [] //记录当前层数 let depth = 0 //每一层的节点 let mid_result = [] //判空 if(!pRoot) return result if(!pRoot.left&&!pRoot.right){ mid_result...