import Tree , { TreeNode } from './BinaryTree' ; param { Tree } tree function isSymmetry ( tree ) { return isSymmetryTree ( tree . root . left , tree . root . right ) ; } param { TreeNode } node1 param { TreeNode } node2 function isSymmetryTree ( node1 , node2 ) { if ( ! node1 && ! node2 ) { return true ; } else if ( ! node1 || ! node2 ) { return false ; } else if ( node1 . val !== node2 . val ) { return false ; } return isSymmetryTree ( node1 . left , node2 . right ) && isSymmetryTree ( node1 . right , node2 . left ) ; } export default isSymmetry ;