摘要:
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public: void preorder(TreeNode *t, int & max,int & sum) { if(t==NULL) { return ; ... 阅读全文