Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. int maxDepth(TNODE *root){
  2.     if (!root) return 0;
  3.     if (root && !root.m_L && !root.m_R) return 1;
  4.     int counterL = maxDepth(root.m_L);    
  5.     int counterR = maxDepth(root.m_R);      
  6.     if (counterL > counterR) return 1 + counterL;
  7.     else return 1 + counterR;
  8. }
Add Comment
Please, Sign In to add comment