
树的遍历
virgilshi
和舒适区说白白(ง'-')ง
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[LeetCode] 124. 二叉树中的最大路径和(深度优先遍历+记忆数组)
124. 二叉树中的最大路径和给定一个非空二叉树,返回其最大路径和。本题中,路径被定义为一条从树中任意节点出发,达到任意节点的序列。该路径至少包含一个节点,且不一定经过根节点。示例 1:输入: [1,2,3] 1 / \ 2 3输出: 6示例 2:输入: [-10,9,20,null,null,15,7] -10 / \ 9 20 / \ 15 7输出: 42解题思路: 此题解题的关键是,要将最大路径原创 2020-06-21 10:18:08 · 622 阅读 · 0 评论 -
1020 Tree Traversals (25 分)(树的遍历)
1020 Tree Traversals (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order t...原创 2018-10-19 15:57:18 · 291 阅读 · 0 评论