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;
See this posted code.
0
solved Depth of BSTree node ( java ) [closed]