// 二叉树---对称二叉树 // 判断是否是对称二叉树 function check(leftPart, rightPart){ if(!leftPart && !rightPart) return true if(!leftPart || !rightPart) return false var result = leftPart.val === rightPart.val && check(leftPart.left, rightPart.right) && check(leftPart.right, rightPart.left) } function isduichen(root){ return check(root, root) }