[LeetCode]Smallest Subtree with all the Deepest Nodes 包含最
A node is?deepest?if it has the largest depth possible among?any node in the?entire tree. The subtree of a node is that node,plus the set of all descendants of that node. Return the node with the largest depth such that it contains all the deepest nodes in its subtree. Example 1: Input: [3,5,1,6,2,8,null,7,4] We return the node with value 2,colored in yellow in the diagram. Note:
https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |