404. Sum of Left Leaves 404.左叶总和

Posted immiao0319

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了404. Sum of Left Leaves 404.左叶总和相关的知识,希望对你有一定的参考价值。

Find the sum of all left leaves in a given binary tree.

Example:

    3
   /   9  20
    /     15   7

There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24.

不是计算么,怎么变成recursive。好吧,还是在外面,还是算DC,就是直接拿来计算了。计算题直接拿来计算就行了
“最左边”这个特质就是左边无、右边也无了。好吧,不说我还真看不出来。

都要加到sum上去才行

以上是关于404. Sum of Left Leaves 404.左叶总和的主要内容,如果未能解决你的问题,请参考以下文章

404. Sum of Left Leaves

Leetcode 404. Sum of Left Leaves

#Leetcode# 404. Sum of Left Leaves

404. Sum of Left Leaves

404. Sum of Left Leaves

404. Sum of Left Leaves