Loading...
Engaged employer
Code to get the depth of a binary tree.
Anonymous
int depth(node * root) { if (root == null) return 0; return max(depth(root->left), depth(root->right) + 1; }
should be easy if you have done it before.
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalised job recommendations and updates by starting your searches.