开发者_运维技巧
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
相关专题:
开发者_运维技巧
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I stuck in depth of BSTree node
does anyone have algorithm or code for finding the depth of BSTree node???
thanks
Psuedocode:
Function Depth
If the right child isn't null, set left_depth to Depth(left_child), else set left_depth to 0.
If the left child isn't null,set right_depth to Depth(right_child), else set right_depth to 0.
return maximum(left_depth, right_depth) + 1;
精彩评论