/* * function TreeNode(x) { * this.val = x; * this.left = null; * this.right = null; * } */ /** * * @param root TreeNode类 * @param sum int整型 * @return bool布尔型 */ //方法一:递归 function preOrder(root,sum,res){ if(root == null){ return false; } res += root.va...