版权声明:本文为博主原创文章,未经博主允许不得转载。 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:
- 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.