Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct TNode {
- int m_Data;
- struct TNode * m_L, * m_R;
- } TNODE;
- int maxDepth (TNODE * root) {
- if (!root)return 0;
- int left = maxDepth(root->m_L);
- int right = maxDepth(root->m_R);
- return 1+(left > right ? left : right);
- }
Add Comment
Please, Sign In to add comment