Sum of Left Leaves
https://leetcode.com/problems/sum-of-left-leaves/description/
Find the sum of all left leaves in a given binary tree
Thoughts
每个节点判断左儿子是否是叶子, 是就把它值加上.
Code
Analysis
时间复杂度O(n).
Last updated
Was this helpful?
https://leetcode.com/problems/sum-of-left-leaves/description/
Find the sum of all left leaves in a given binary tree
每个节点判断左儿子是否是叶子, 是就把它值加上.
时间复杂度O(n).
Last updated
Was this helpful?