061:求根节点到叶节点数字之和
LeetCode 129 https://leetcode.cn/problems/sum-root-to-leaf-numbers/description/ 难度:中等 高频面试题汇总:https://www.yuweihung.com/posts/2025/lc-hot/ 使用参数记录路径之和,当当前节点为叶子节点时更新答案,并处理节点为空的情况。 时间复杂度:O(n),其中 n 为二叉树的节点个数。 空间复杂度:O(n)。最坏情况下,二叉树退化成一条链,递归需要 O(n) 的栈空间。 ...