Given a binary tree, find the leftmost value in the last row of the tree. 就是拿到最后一层的第一个元素。 这个元素是最左下角的元素,不是最左侧的元素。 如果想实现 其实也很简单 就是维护更新每一层的第一个元素。 class Solution { public int findBottomLeftValue(TreeNode root) { if (root =...
Find the sum of all left leaves in a given binary tree think about this, when we reached leaf, how are we gonna to know if it is left leaf or not? of course we can modify the iterate version of preorder traverse, it’s very simple. but how are we gonna do it recursively? class...