leetcode-865-Smallest Subtree with all the Deepest Nodes

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zem_nezer/article/details/86619960

With pattern:

if(node == NULL){
 // do something
}
left = do_something(root->left)
right = do_something(root->right)
do_something with root, left, right

we can get that, left and right return its depth and the deepest node’s parents

Error:

  1. do not know the meaning of function and its return, with function depth(root), we return current depth of subtree, and the deepest node in the pair structure.

猜你喜欢

转载自blog.csdn.net/zem_nezer/article/details/86619960