Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【每日一题】- 2019-08-09 - 96. 不同的二叉搜索树 #90

Closed
azl397985856 opened this issue Aug 8, 2019 · 4 comments
Closed
Assignees
Labels
Daily Question 每日一题

Comments

@azl397985856
Copy link
Owner

给你一个有根节点的二叉树,找到它最深的叶节点的最近公共祖先。

回想一下:

叶节点 是二叉树中没有子节点的节点
树的根节点的 深度 为 0,如果某一节点的深度为 d,那它的子节点的深度就是 d+1
如果我们假定 A 是一组节点 S 的 最近公共祖先,S中的每个节点都在以 A 为根节点的子树中,且 A 的深度达到此条件下可能的最大值。
 

示例 1:

输入:root = [1,2,3]
输出:[1,2,3]
示例 2:
Explanation:
The deepest leaves are the nodes with values 2 and 3.
The lowest common ancestor of these leaves is the node with value 1.
The answer returned is a TreeNode object (not an array) with serialization "[1,2,3]".

输入:root = [1,2,3,4]
输出:[4]
示例 3:

输入:root = [1,2,3,4,5]
输出:[2,4,5]
 

提示:

给你的树中将有 1 到 1000 个节点。
树中每个节点的值都在 1 到 1000 之间。

来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/lowest-common-ancestor-of-deepest-leaves
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。

@azl397985856 azl397985856 changed the title 【每日一题】- 2019-08-08 - 79. 单词搜索 【每日一题】- 2019-08-08 - Aug 8, 2019
@azl397985856 azl397985856 changed the title 【每日一题】- 2019-08-08 - 【每日一题】- 2019-08-08 - 96. 不同的二叉搜索树 Aug 8, 2019
@azl397985856 azl397985856 added the Daily Question 每日一题 label Aug 8, 2019
@3460741663
Copy link
Contributor

认领

@azl397985856
Copy link
Owner Author

认领

done

@sundaymoring
Copy link

认领

@azl397985856
Copy link
Owner Author

认领

已经有人认领啦。 你看楼上

@azl397985856 azl397985856 moved this from 待认领 to 正在进行 in 《每日一题》综合认领区 Aug 10, 2019
@azl397985856 azl397985856 changed the title 【每日一题】- 2019-08-08 - 96. 不同的二叉搜索树 【每日一题】- 2019-08-09 - 96. 不同的二叉搜索树 Aug 13, 2019
raof01 added a commit to raof01/leetcode that referenced this issue Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily Question 每日一题
Projects
Development

No branches or pull requests

3 participants