404. Sum of Left Leaves
来源:互联网 发布:时时彩源码之家 编辑:程序博客网 时间:2024/04/30 19:09
class Solution {public: int sumOfLeftLeaves(TreeNode* root) { int sum=0; Preorder(root,sum); return sum; } void Preorder(TreeNode* root,int &sum) { if(root) { if(root->left!=NULL&&root->left->left==NULL&&root->left->right==NULL) sum=sum+root->left->val; Preorder(root->left,sum); Preorder(root->right,sum); } }};
0 0
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves*
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- 404. Sum of Left Leaves
- Thread
- 51nod-1105 第K大的数
- 查看内核中函数所在的头文件
- 源码-Oracle数据库管理-第七章-视图-Part 3(物化视图)
- 2-SAT ( Tarjan )——POJ 3207
- 404. Sum of Left Leaves
- Python
- Atitit.研发团队的管理原则---立长不立贤与按资排辈原则
- Listener、Filter、Servlet 初始化顺序
- 设计模式学习(二十四)————职责链模式
- 剑指offer_输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字
- bootstrap样式无法覆盖问题解决办法
- 爬虫学习——编解码错误
- 设计模式学习(二十五)————中介者模式