树
鸡蛋豆腐仙子
从本科开始讨厌了单片机 晶体管 编程 c++5-6年后,发现技术就是我的真爱,再重新选择一次,我还是会选择当程序员。我现在觉得自己什么都不会,可是还是相信会变成别人仰望的大神。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【刷题】Leetcode 236. Lowest Common Ancestor of a Binary Tree
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { Tr...原创 2019-11-24 23:06:40 · 123 阅读 · 0 评论 -
【刷题】Leetcode 96. Unique Binary Search Trees
Example: Input: 3 Output: 5 Explanation: Given n = 3, there are a total of 5 unique BST’s: 1 3 3 2 1 \ / / / \ 3 2 1 1 3 2 / / ...原创 2019-11-18 18:45:32 · 109 阅读 · 0 评论 -
【刷题】Leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal
For example, given inorder = [9,3,15,20,7] postorder = [9,15,7,20,3] Return the following binary tree: 3 / 9 20 / 15 7 /** * Definition for a binary tree node. * public class TreeNode { * ...原创 2019-11-18 16:21:31 · 129 阅读 · 0 评论 -
【刷题】Leetcode 572. Subtree of Another Tree
Example 1: Given tree s 3 / \ 4 5 / 1 2 Given tree t: 4 / 1 2 这里return啊,if啊的顺序很重要,要不得就错了 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode...原创 2019-11-18 16:15:06 · 104 阅读 · 0 评论
分享