function TreeNode(x) { this.val = x; this.left = null; this.right = null; } function Serialize(pRoot) { if (pRoot === null) return "#"; var res = []; SerializeFunc(pRoot, res); return res.join(""); } function SerializeFunc(root, str) { if (root === null) { ...